Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Returns just dictionary when loading .topostats #112

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

ns-rse
Copy link
Collaborator

@ns-rse ns-rse commented Feb 4, 2025

Closes #109

Rather than return the HDF5 object loaded from .topostats as a dictionary as the third item in a tuple along with the
image and pixel_to_nm_scaling (both of which are extracted from the loaded data anyway) just the dictionary is
returned. This matches the structure of objects created by TopoStats and how they are saved to HDF5 files.

Closes #109

Rather than return the HDF5 object loaded from `.topostats` as a dictionary as the third item in a tuple along with the
`image` and `pixel_to_nm_scaling` (both of which are extracted from the loaded data anyway) just the dictionary is
returned. This matches the structure of objects created by TopoStats and how they are saved to HDF5 files.
@ns-rse ns-rse added topostats Loading the .topotats file format v0.1.0 labels Feb 4, 2025
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.58%. Comparing base (ac9753c) to head (0fb1dbd).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #112      +/-   ##
==========================================
- Coverage   74.62%   74.58%   -0.05%     
==========================================
  Files           8        8              
  Lines         607      606       -1     
==========================================
- Hits          453      452       -1     
  Misses        154      154              

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

Copy link
Collaborator

@SylviaWhittle SylviaWhittle left a comment

Choose a reason for hiding this comment

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

Not tested locally but fail to see what could break here.

Must remember that when a PyPI release is made, in TopoStats, to require AFMReader's version to be at least that one, since TopoStats will expect a single dictionary instead of a tuple. A little bit of a headache with changing TopoStats and AFMReader's interoperability ^^;

@ns-rse
Copy link
Collaborator Author

ns-rse commented Feb 4, 2025

Thanks @SylviaWhittle for the review and approval 👍

Must remember that when a PyPI release is made, in TopoStats, to require AFMReader's version to be at least that one, since TopoStats will expect a single dictionary instead of a tuple. A little bit of a headache with changing TopoStats and AFMReader's interoperability ^^;

Yeah, I was trying to think how to handle that, its ok on development and once a release is made of both but if people explicitly install an older version of TopoStats that pulls in the newer version of AFMReader that won't work (might arise if pip uses cached packages so we should perhaps update documentation to include --no-cache-dir advice when using pip install and make it really prominent on the README.md as well as the website.

I'll look into whether its possible to add warnings about this, perhaps to a new release of AFMReader to the tune of This only works with TopoStats >= 2.x.x if you are using an older version you will have to manually downgrade AFMReader using pip install AFMReader==0.0.4 or similar as we can't modify already released versions of TopoStats to provide such a warning.

@ns-rse ns-rse merged commit ad801fc into main Feb 4, 2025
13 checks passed
@ns-rse ns-rse deleted the ns-rse/109-topostats-data branch February 4, 2025 21:49
@ns-rse
Copy link
Collaborator Author

ns-rse commented Feb 5, 2025

I've written up what might need updating/changing in TopoStats # 1086.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topostats Loading the .topotats file format v0.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Return just data when loading .topostats
3 participants