Skip to content

Conversation

@manuschneider
Copy link
Collaborator

Fixes #727.

If no file extension is given, the standard extension for the corresponding object type is added to the filename.

This is backwards compatible with the previous behavior but allows to use custom file extensions and call Save() and Load() with the exact same arguments.

@codecov
Copy link

codecov bot commented Dec 5, 2025

Codecov Report

❌ Patch coverage is 16.66667% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 35.29%. Comparing base (e87c3a2) to head (91dd9ac).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/Bond.cpp 0.00% 8 Missing ⚠️
src/Symmetry.cpp 0.00% 8 Missing ⚠️
src/backend/Storage.cpp 0.00% 8 Missing ⚠️
src/tn_algo/MPS.cpp 0.00% 7 Missing ⚠️
src/Tensor.cpp 25.00% 5 Missing and 1 partial ⚠️
src/UniTensor.cpp 66.66% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #728      +/-   ##
==========================================
+ Coverage   32.35%   35.29%   +2.94%     
==========================================
  Files         215      215              
  Lines       36363    33037    -3326     
  Branches    14597    13165    -1432     
==========================================
- Hits        11764    11661     -103     
+ Misses      22659    19462    -3197     
+ Partials     1940     1914      -26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@IvanaGyro IvanaGyro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest deprecate the feature that automatically adds file extension while saving and keep the function for loading unchanged. Automatically appending file extension while saving and loading files is uncommon practice.

Additionally, can you squash the two commits in this PR?

@manuschneider
Copy link
Collaborator Author

I suggest deprecate the feature that automatically adds file extension while saving and keep the function for loading unchanged. Automatically appending file extension while saving and loading files is uncommon practice.

I thought it might actually be handy to just provide the base name and cytnx will add the common extension for this type of object. We can have a separate issue on deprecating this, but this might affect basically all unit tests.

Additionally, can you squash the two commits in this PR?

How do I best squash them with git?

@IvanaGyro
Copy link
Collaborator

How do I best squash them with git?

Using git rebase -i is the most intuitive way. See: https://stackoverflow.com/a/5189600

if no file extension is given, the standard extension for the corresponding object type is added to the filename
this is backwards compatible with the previous behavior but allows to use custom file extensions and call Save() and Load() with the exact same arguments
@manuschneider manuschneider added this to the v1.1.0 milestone Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File extension with Save and Load

3 participants