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 saturation flag issue for numpy 2+ in romancal #305

Merged

Conversation

WilliamJamieson
Copy link
Collaborator

The saturation step fails in stcal when running using numpy 2+. This appears to be caused by the use of an IntEnum by Roman instead of a dictionary. I believe this might be due to a numpy bug reported in numpy/numpy#27540.

In the mean time, the easiest fix is to cast the values directly to python int even though the IntEnum members should be python int values. In theory, this should be a totally transparent change to all code except on numpy 2+ when passing an IntEnum, in which case it simply strips the Enum related bits of the integer.

Tasks

  • update or add relevant tests
  • update relevant docstrings and / or docs/ page
  • Does this PR change any API used downstream? (if not, label with no-changelog-entry-needed)
    • write news fragment(s) in changes/: echo "changed something" > changes/<PR#>.<changetype>.rst (see below for change types)
    • run regression tests with this branch installed ("git+https://github.com/<fork>/stcal@<branch>")
news fragment change types...
  • changes/<PR#>.apichange.rst: change to public API
  • changes/<PR#>.bugfix.rst: fixes an issue
  • changes/<PR#>.general.rst: infrastructure or miscellaneous change

Copy link

codecov bot commented Oct 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.23%. Comparing base (60bd3b8) to head (c9b926c).
Report is 50 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #305      +/-   ##
==========================================
+ Coverage   86.21%   86.23%   +0.02%     
==========================================
  Files          47       47              
  Lines        8812     8826      +14     
==========================================
+ Hits         7597     7611      +14     
  Misses       1215     1215              

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

Copy link
Collaborator

@schlafly schlafly left a comment

Choose a reason for hiding this comment

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

LGTM, thanks William.

@WilliamJamieson WilliamJamieson force-pushed the bugfix/roman_enum_numpy2 branch from 75de6ae to c9b926c Compare October 10, 2024 17:17
@WilliamJamieson WilliamJamieson merged commit 28b1245 into spacetelescope:main Oct 10, 2024
25 of 26 checks passed
@WilliamJamieson WilliamJamieson deleted the bugfix/roman_enum_numpy2 branch October 10, 2024 17:30
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.

3 participants