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 multi-threaded reprojection when using Astropy WCS #434

Merged
merged 8 commits into from
Apr 11, 2024

Conversation

astrofrog
Copy link
Member

@astrofrog astrofrog commented Mar 25, 2024

To run just the relevant test:

tox -e test -- -k "test_dask_scheduler"

This currently shows three test failures:

FAILED ../../.tox/test/lib/python3.11/site-packages/reproject/tests/test_high_level.py::test_dask_schedulers[threads-reproject_interp] - AssertionError: 
FAILED ../../.tox/test/lib/python3.11/site-packages/reproject/tests/test_high_level.py::test_dask_schedulers[threads-reproject_adaptive] - AssertionError: 
FAILED ../../.tox/test/lib/python3.11/site-packages/reproject/tests/test_high_level.py::test_dask_schedulers[threads-reproject_exact] - AssertionError: 

To run just one of the parameter combinations of the test, one can do e.g.:

tox -e test -- -k "test_dask_sched and interp and threads"

Copy link

codecov bot commented Mar 25, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 93.63%. Comparing base (2dedbc5) to head (b42f7c6).
Report is 17 commits behind head on main.

Files Patch % Lines
reproject/common.py 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #434      +/-   ##
==========================================
+ Coverage   93.60%   93.63%   +0.02%     
==========================================
  Files          25       25              
  Lines         892      895       +3     
==========================================
+ Hits          835      838       +3     
  Misses         57       57              

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

@manodeep
Copy link

Should the deep copy only be done for the multi-threading case, or is the copy so fast + low-memory that it does not matter

@astrofrog
Copy link
Member Author

@manodeep - the deep copy only takes ~10µs for a typical WCS, so it will be buried in the noise

@astrofrog astrofrog changed the title Added regression test for multi-threaded issues Fix multi-threaded reprojection when using Astropy WCS Apr 9, 2024
@astrofrog
Copy link
Member Author

The fix here is a workaround but it is acceptable enough to just go ahead and merge, as even though it does not fix astropy upstream, it should basically make multi-threading usable here.

@astrofrog astrofrog requested a review from Cadair April 9, 2024 12:22
@astrofrog astrofrog marked this pull request as ready for review April 9, 2024 12:22
@astrofrog
Copy link
Member Author

Let's get this fix in 🚀

@astrofrog astrofrog merged commit c6d64b3 into astropy:main Apr 11, 2024
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