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 dependencies. Simplify tests. Reduce data file size. Add a new unit test. #166

Merged
merged 2 commits into from
Jan 3, 2025

Conversation

mcara
Copy link
Member

@mcara mcara commented Dec 27, 2024

  1. This PR removes astropy as a dependency but keeps it as a dependency only for testing.
  2. This PR uses pytest.mark.parametrize to combine multiple tests into a single one.
  3. This PR removes several reference data files that can be reproduced by, i.e., changing CRPIX value in another file (input3 and input1. the later was renamed to j8bt06nyq_sip_flt.fits).
  4. When an image file such as j8bt06nyq_sip_flt.fits was used only to supply the WCS, I have removed SCI/ERR/DQ data arrays to reduce the size of the package. Something similar was done with other files such as reference_blot_*.fits and reference_{kernel_name}_*.fits since only SCI images was used in testing: I kept only the SCI extension and removed WHT and CTX extensions.
  5. I added a new test that actually resamples j8bt06nyq_flt.fits and checks the result (it checks SCI/WHT and CTX extensions) against reference_turbo_image.fits and reference_square_image.fits. These reference files were in this repository since it was created but they were never used before. In order to make the test work, image intensity (scale parameter) had to be set to the ratio between the output pixel scale and input pixel scale which appear to be different from the default value of 1. This will need to be investigated further and maybe "OKify" current results in order to get rid of setting this scale argument. Another limitation is that this test works for the inner region of the image. At the edges (the slanted edges) of the image, the edge of the input image forms a staircase. Some pixels along the border are different. Most probably this is a result of a change in how overlaps (between input and output) are computed and rasterized. I think this is a minor issue.

@mcara mcara added the testing label Dec 27, 2024
@mcara mcara requested review from nden and s-goldman December 27, 2024 06:37
@mcara mcara self-assigned this Dec 27, 2024
@mcara mcara requested a review from a team as a code owner December 27, 2024 06:37
Copy link

codecov bot commented Dec 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.27%. Comparing base (ca5da2a) to head (84f0822).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #166   +/-   ##
=======================================
  Coverage   97.27%   97.27%           
=======================================
  Files           3        3           
  Lines         220      220           
=======================================
  Hits          214      214           
  Misses          6        6           

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

@mcara mcara merged commit a6fd81a into spacetelescope:main Jan 3, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants