Skip to content

Fix failing test due to changes in dask.keys keyword#2888

Merged
ericpre merged 1 commit intohyperspy:RELEASE_next_patchfrom
magnunor:fix_dask_hdf5_close_file
Feb 17, 2022
Merged

Fix failing test due to changes in dask.keys keyword#2888
ericpre merged 1 commit intohyperspy:RELEASE_next_patchfrom
magnunor:fix_dask_hdf5_close_file

Conversation

@magnunor
Copy link
Contributor

Currently a test in RELEASE_next_minor is failing: FAILED hyperspy/tests/io/test_hdf5.py::test_saving_close_file.

This is due to this code:

for key in self.data.dask.keys():
    if "array-original" in key:
        arrkey = key
        break

Since dask-2022.1.1 this key starts with original-array, while in dask-2022.1.0 (and earlier), array-original.

There has been some changes in RELEASE_next_minor, compared to RELEASE_next_patch. In RNp, this functionality is in close_file (https://github.com/hyperspy/hyperspy/blob/RELEASE_next_patch/hyperspy/_signals/lazy.py#L171)

In RNm, this is in _get_file_handle (https://github.com/hyperspy/hyperspy/blob/RELEASE_next_minor/hyperspy/_signals/lazy.py#L323)


Thus, this pull request fixes the issue in RNp, which should be easy to "move" to RNm.

This is due to a change from dask-2022.1.1.
@codecov
Copy link

codecov bot commented Feb 17, 2022

Codecov Report

Merging #2888 (6131d08) into RELEASE_next_patch (3bc72ca) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@                  Coverage Diff                   @@
##           RELEASE_next_patch    #2888      +/-   ##
======================================================
- Coverage               77.62%   77.61%   -0.02%     
======================================================
  Files                     202      202              
  Lines                   30113    30113              
  Branches                 6776     6776              
======================================================
- Hits                    23375    23371       -4     
- Misses                   4996     5002       +6     
+ Partials                 1742     1740       -2     
Impacted Files Coverage Δ
hyperspy/_signals/lazy.py 90.67% <100.00%> (+0.96%) ⬆️
hyperspy/misc/eels/eelsdb.py 50.72% <0.00%> (-14.50%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3bc72ca...6131d08. Read the comment docs.

Copy link
Member

@ericpre ericpre left a comment

Choose a reason for hiding this comment

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

For future reference, it seems to be coming from dask/dask#7417.
It is not great to rely on the name of dask keys but this is another story!

@ericpre ericpre merged commit 63fef9a into hyperspy:RELEASE_next_patch Feb 17, 2022
@magnunor magnunor deleted the fix_dask_hdf5_close_file branch February 18, 2022 11:39
magnunor added a commit to magnunor/hyperspy that referenced this pull request Feb 18, 2022
This is due to a change which was introduced in dask-2022.1.1.

Seems to be coming from: dask/dask#7417
Related pull request: hyperspy#2888
ericpre pushed a commit to ericpre/rosettasciio that referenced this pull request Jul 23, 2022
This is due to a change which was introduced in dask-2022.1.1.

Seems to be coming from: dask/dask#7417
Related pull request: hyperspy/hyperspy#2888
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants