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

Fix a bug that caused big-endian dask arrays to not be reprojected correctly #487

Merged
merged 5 commits into from
Feb 1, 2025

Conversation

astrofrog
Copy link
Member

I'm surprised I didn't run into this sooner, but this should fix the endianness issue @keflavich - can you confirm?

@astrofrog astrofrog added the bug label Feb 1, 2025
@@ -53,7 +53,7 @@ def _dask_to_numpy_memmap(dask_array, tmp_dir):

memmapped_array = np.memmap(
memmap_path,
dtype=zarr_array.dtype,
dtype=float,
Copy link
Member Author

Choose a reason for hiding this comment

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

The memmap was read later on assuming it was native float.

Copy link

codecov bot commented Feb 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.00%. Comparing base (1e5c275) to head (9f4ad1c).
Report is 21 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #487      +/-   ##
==========================================
+ Coverage   90.90%   91.00%   +0.10%     
==========================================
  Files          25       25              
  Lines        1077     1078       +1     
==========================================
+ Hits          979      981       +2     
+ Misses         98       97       -1     

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

@astrofrog
Copy link
Member Author

I think I need to check the case where output_array is passed and it has a different itemsize to the input

@astrofrog
Copy link
Member Author

But for now I think it should work @keflavich

@keflavich
Copy link
Contributor

Yes, this solves the problem; I didn't realize there was a dask reader/converter built in to reproject.

I'll rebase #474 against this and remove the hack I implemented.

@astrofrog astrofrog merged commit ed556da into astropy:main Feb 1, 2025
22 of 23 checks passed
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