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

Use multiclass of uint32 and Enum rather than IntEnum #402

Conversation

WilliamJamieson
Copy link
Collaborator

As part of the discussion in numpy/numpy#27540 about an issue related to the dq flags, it was suggested to instead do a multiclass of np.uint32 and Enum rather than IntEnum (which under the hood is a multiclass of int and Enum). This is so that we prevent any mistakes related to choosing invalid integers under uint32.

Tasks

  • Update or add relevant roman_datamodels tests.
  • Update relevant docstrings and / or docs/ page.
  • Does this PR change any API used downstream? (If not, label with no-changelog-entry-needed.)
News fragment change types:
  • changes/<PR#>.feature.rst: new feature
  • changes/<PR#>.bugfix.rst: fixes an issue
  • changes/<PR#>.doc.rst: documentation change
  • changes/<PR#>.removal.rst: deprecation or removal of public API
  • changes/<PR#>.misc.rst: infrastructure or miscellaneous change

@WilliamJamieson WilliamJamieson requested a review from a team as a code owner October 15, 2024 18:31
Copy link

codecov bot commented Oct 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.42%. Comparing base (087a60d) to head (57449fe).
Report is 66 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #402      +/-   ##
==========================================
- Coverage   97.56%   97.42%   -0.14%     
==========================================
  Files          30       37       +7     
  Lines        2788     3451     +663     
==========================================
+ Hits         2720     3362     +642     
- Misses         68       89      +21     

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

@WilliamJamieson WilliamJamieson force-pushed the feature/use_uint32_over_IntEnum branch 3 times, most recently from e500333 to 50b193f Compare October 18, 2024 19:11
Copy link
Collaborator

@PaulHuwe PaulHuwe left a comment

Choose a reason for hiding this comment

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

This looks good to me - let's wait until the mid-build release and then do a regtest with it as a sanity check.

@WilliamJamieson WilliamJamieson force-pushed the feature/use_uint32_over_IntEnum branch from 61d0ac8 to b837af0 Compare October 30, 2024 17:15
@WilliamJamieson
Copy link
Collaborator Author

This looks good to me - let's wait until the mid-build release and then do a regtest with it as a sanity check.

This is currently blocked by spacetelescope/romancal/#1480, which makes a small change to cast back to python integer due to use of one of the methods that numpy integers do not replicate from python integers.

@WilliamJamieson WilliamJamieson force-pushed the feature/use_uint32_over_IntEnum branch from b837af0 to daa1930 Compare November 1, 2024 18:15
@WilliamJamieson
Copy link
Collaborator Author

@WilliamJamieson WilliamJamieson force-pushed the feature/use_uint32_over_IntEnum branch from daa1930 to 0caaf7b Compare November 4, 2024 20:09
Copy link
Collaborator

@PaulHuwe PaulHuwe left a comment

Choose a reason for hiding this comment

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

LGTM

@WilliamJamieson WilliamJamieson force-pushed the feature/use_uint32_over_IntEnum branch from 0caaf7b to 57449fe Compare November 11, 2024 18:34
@WilliamJamieson WilliamJamieson merged commit b374e0e into spacetelescope:main Nov 11, 2024
17 of 18 checks passed
@WilliamJamieson WilliamJamieson deleted the feature/use_uint32_over_IntEnum branch November 11, 2024 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants