Skip to content

Conversation

@mairanteodoro
Copy link
Collaborator

@mairanteodoro mairanteodoro commented Sep 9, 2025

This PR updates a few unit tests to prevent VAR_RNOISE from being a zeroed array (such edge case might need to be addressed eventually).

For the following two unit tests, we increased the value of im.var_rnoise from zero to 0.01:

  • test_custom_wcs_resample_imaging;
  • test_custom_refwcs_resample_imaging;

Additionally, the error in test_custom_refwcs_pixel_shape_imaging was caused by an incorrect pixel_shape specification in the WCS. The test was setting result.meta.wcs.pixel_shape = data1.shape where data1.shape is in NumPy's (ny, nx) format (height, width), but WCS pixel_shape expects (nx, ny) format (width, height). The test now correctly verifies that:

  • the WCS can use an explicit pixel_shape setting;
  • the output shape matches the expected dimensions;
  • the pixel area can be set correctly in the result metadata.

This PR also contains a temporary change to pyproject.toml so that it can run against the stcal changes listed in PR #359.

Note

This PR depends on changes in the following PR:

Regression tests

All the regression tests are passing:

Tasks

  • If you have a specific reviewer in mind, tag them.
  • add a build milestone, i.e. Build 12.0 (use the latest build if not sure)
  • Does this PR change user-facing code / API? (if not, label with no-changelog-entry-needed)
    • write news fragment(s) in changes/: echo "changed something" > changes/<PR#>.<changetype>.rst (see changelog readme for instructions)
    • update or add relevant tests
    • update relevant docstrings and / or docs/ page
    • start a regression test and include a link to the running job (click here for instructions)
      • Do truth files need to be updated ("okified")?
        • after the reviewer has approved these changes, run okify_regtests to update the truth files
  • if a JIRA ticket exists, make sure it is resolved properly

@mairanteodoro mairanteodoro requested review from a team as code owners September 9, 2025 15:59
@mairanteodoro mairanteodoro changed the title Prevent VAR_RNOISE Prevent VAR_RNOISE from being a zeroed array. Sep 9, 2025
@melanieclarke melanieclarke added this to the Build 12.1 milestone Sep 9, 2025
@mairanteodoro mairanteodoro force-pushed the mteodoro_sky_var_rdnoise branch from 78dbec6 to cba313e Compare September 9, 2025 16:19
@mairanteodoro mairanteodoro requested review from a team and tapastro September 9, 2025 16:24
@codecov
Copy link

codecov bot commented Sep 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.38%. Comparing base (0986d7b) to head (9f376e1).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9813   +/-   ##
=======================================
  Coverage   83.38%   83.38%           
=======================================
  Files         366      366           
  Lines       37771    37771           
=======================================
  Hits        31494    31494           
  Misses       6277     6277           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pllim
Copy link
Collaborator

pllim commented Sep 10, 2025

pre-commit.ci autofix

@pllim
Copy link
Collaborator

pllim commented Sep 10, 2025

I took the liberty of asking the bot to fix pre-commit check failures. Hope you don't mind. Looking at what angered the bot, you might have to configure your editor to automatically delete trailing whitespace on save. FYI.

@mairanteodoro mairanteodoro force-pushed the mteodoro_sky_var_rdnoise branch from 2b90196 to 427d986 Compare September 10, 2025 17:16
@mairanteodoro
Copy link
Collaborator Author

I took the liberty of asking the bot to fix pre-commit check failures. Hope you don't mind. Looking at what angered the bot, you might have to configure your editor to automatically delete trailing whitespace on save. FYI.

Thanks, @pllim! I will set my editor to take care of that, but I thought these simple style-check fixes were being taken care of during the pre-commit phase... apparently I'm wrong.

@mairanteodoro mairanteodoro force-pushed the mteodoro_sky_var_rdnoise branch 3 times, most recently from da592ac to aa9af83 Compare September 11, 2025 17:49
mairanteodoro and others added 7 commits September 11, 2025 14:47
The assertion error in the test was caused by an incorrect pixel_shape
specification in the WCS. The test was setting
result.meta.wcs.pixel_shape = data1.shape where data1.shape is in
NumPy's (ny, nx) format (height, width), but WCS pixel_shape expects
(nx, ny) format (width, height).
Removed commented-out code related to 'im.var_rnoise'.
@mairanteodoro mairanteodoro force-pushed the mteodoro_sky_var_rdnoise branch from aa9af83 to 32595dc Compare September 11, 2025 18:47
@mairanteodoro mairanteodoro merged commit 012dfaf into spacetelescope:main Sep 12, 2025
28 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.

4 participants