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

Add modes for nan and inf handling to adaptive algo #380

Merged
merged 2 commits into from
Sep 7, 2023

Conversation

svank
Copy link
Contributor

@svank svank commented Aug 17, 2023

I found myself reprojecting images with NaNs and infs, so I added a few modes for how to deal with them. The default remains the previous behavior, which just propagates these values with no special handling.

The constant mode isn't strictly necessary, as one could use np.nan_to_num on the input array before reprojecting, but implementing this in reproject avoids having to copy the array---maybe that's important for dask use cases.

@codecov
Copy link

codecov bot commented Aug 17, 2023

Codecov Report

Merging #380 (a4312de) into main (661963d) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #380   +/-   ##
=======================================
  Coverage   93.44%   93.44%           
=======================================
  Files          25       25           
  Lines         870      870           
=======================================
  Hits          813      813           
  Misses         57       57           
Files Changed Coverage Δ
reproject/adaptive/core.py 95.91% <ø> (ø)
reproject/adaptive/high_level.py 100.00% <ø> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@astrofrog
Copy link
Member

I've rebased this and have also changed bad_val_mode to bad_value_mode - I try and avoid abbreviations if it only saves a couple of letters. Hope that's ok! Will merge once CI passes.

@astrofrog astrofrog merged commit 6e9a934 into astropy:main Sep 7, 2023
18 of 19 checks passed
@svank
Copy link
Contributor Author

svank commented Sep 7, 2023

@astrofrog Thanks for tying off these PRs! Happy to see another release 🎉

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.

None yet

2 participants