hyperspy icon indicating copy to clipboard operation
hyperspy copied to clipboard

s.save docstring: for write_dataset parameter add zspy

Open magnunor opened this issue 1 year ago • 5 comments

When working with really large datasets, it is nice to change the metadata without having to rewrite the whole dataset.

Currently, the docstring only mentions .hspy but it seems to work for (at least) the default .zspy (in other words, the folder structure one).

However, I'm not sure if this will work for different zarr readers/writers.

Description of the change

  • Add .zspy to s.save(write_dataset) parameter.

@CSSFrancis

magnunor avatar Jul 23 '23 16:07 magnunor

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (056670f) 81.22% compared to head (6f12b24) 84.11%. Report is 666 commits behind head on RELEASE_next_major.

Files Patch % Lines
hyperspy/decorators.py 96.20% 2 Missing and 1 partial :warning:
hyperspy/drawing/_widgets/horizontal_line.py 66.66% 0 Missing and 1 partial :warning:
hyperspy/drawing/_widgets/rectangles.py 66.66% 0 Missing and 1 partial :warning:
hyperspy/drawing/_widgets/vertical_line.py 66.66% 0 Missing and 1 partial :warning:
hyperspy/drawing/widget.py 83.33% 1 Missing :warning:
Additional details and impacted files
@@                  Coverage Diff                   @@
##           RELEASE_next_major    #3203      +/-   ##
======================================================
+ Coverage               81.22%   84.11%   +2.89%     
======================================================
  Files                     173      197      +24     
  Lines                   24164    32718    +8554     
  Branches                 5618     8883    +3265     
======================================================
+ Hits                    19626    27521    +7895     
- Misses                   3247     3615     +368     
- Partials                 1291     1582     +291     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jul 23 '23 17:07 codecov[bot]

@magnunor it would be worth adding a test for this just to make sure. I think I've tested it a couple of time with varying results?

CSSFrancis avatar Jul 23 '23 17:07 CSSFrancis

Based on rosettaio, it seems like this is already tested for: https://github.com/hyperspy/rosettasciio/blob/main/rsciio/tests/test_hspy.py#L924

I added a sentence about this only working with the default zspy file writer (DirectoryStore).

magnunor avatar Jul 23 '23 23:07 magnunor

As part of the split, this docstring needs to be changed, because as it is, it is not maintainable! Either it should refer to the rosettasciio docstring or pull all the arguments from the relevant function in rosettasciio.

ericpre avatar Jul 24 '23 09:07 ericpre

Re-opening because this has been closed automatically by mistake!

ericpre avatar Dec 22 '23 14:12 ericpre