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

Remove dqflags and related code. #146

Merged

Conversation

WilliamJamieson
Copy link
Collaborator

@WilliamJamieson WilliamJamieson commented Mar 1, 2023

This PR removes the code moved to stdatamodels in spacetelescope/stdatamodels#134. I don't think any of the dqflags related code is actually used outside the jwst pipeline, so this should not effect any packages.

Note, I replaced the removed code with thin wrapper modules which raise a deprecation warning and then attempt to import from stdatamodels, raising a useful error if that import fails.

Closes #145

Checklist

  • added entry in CHANGES.rst (either in Bug Fixes or Changes to API)
  • updated relevant tests
  • updated relevant documentation
  • updated relevant milestone(s)
  • added relevant label(s)

@codecov
Copy link

codecov bot commented Mar 1, 2023

Codecov Report

Patch coverage: 88.57% and project coverage change: +0.18 🎉

Comparison is base (6eff679) 72.13% compared to head (245fff9) 72.32%.

❗ Current head 245fff9 differs from pull request most recent head 038bd07. Consider uploading reports for the commit 038bd07 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #146      +/-   ##
==========================================
+ Coverage   72.13%   72.32%   +0.18%     
==========================================
  Files          28       29       +1     
  Lines        5470     5459      -11     
==========================================
+ Hits         3946     3948       +2     
+ Misses       1524     1511      -13     
Flag Coverage Δ
unit 72.32% <88.57%> (+0.18%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/stcal/basic_utils.py 85.71% <85.71%> (-14.29%) ⬇️
src/stcal/dqflags.py 85.71% <85.71%> (-6.60%) ⬇️
src/stcal/dynamicdq.py 85.71% <85.71%> (+58.44%) ⬆️
tests/test_dq.py 92.30% <92.30%> (-7.70%) ⬇️
src/stcal/conftest.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@WilliamJamieson
Copy link
Collaborator Author

Converting to a draft because spacetelescope/stdatamodels#134 needs to be merged and released before these changes will fully work.

@WilliamJamieson WilliamJamieson force-pushed the refactor/move_dq_to_stdatamodels branch from 32b6dbd to 0efbc77 Compare March 3, 2023 18:07
@WilliamJamieson WilliamJamieson requested a review from PaulHuwe March 7, 2023 16:18
@WilliamJamieson WilliamJamieson marked this pull request as ready for review March 8, 2023 00:29
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.

Should more dependencies be added to tox.ini? When I run STCAL tests, I get the following errors:

FAILED tests/test_dq.py::test_deprecation[dqflags] - ImportError: dqflags has been moved to stdatamodels.dqflags, please install stdatamodels
FAILED tests/test_dq.py::test_deprecation[dynamicdq] - ImportError: dynamicdq has been moved to stdatamodels.dynamicdq, please install stdatamodels
FAILED tests/test_dq.py::test_deprecation[basic_utils] - ImportError: basic_utils has been moved to stdatamodels.basic_utils, please install stdatamodels

@WilliamJamieson
Copy link
Collaborator Author

Should more dependencies be added to tox.ini? When I run STCAL tests, I get the following errors:

FAILED tests/test_dq.py::test_deprecation[dqflags] - ImportError: dqflags has been moved to stdatamodels.dqflags, please install stdatamodels FAILED tests/test_dq.py::test_deprecation[dynamicdq] - ImportError: dynamicdq has been moved to stdatamodels.dynamicdq, please install stdatamodels FAILED tests/test_dq.py::test_deprecation[basic_utils] - ImportError: basic_utils has been moved to stdatamodels.basic_utils, please install stdatamodels

I don't think you have the right things installed, you need to try re-installing.

@PaulHuwe
Copy link
Collaborator

PaulHuwe commented Mar 8, 2023

Details

Turns out that having too old a version of stdatamodels installed caused this.

@WilliamJamieson
Copy link
Collaborator Author

Details

Turns out that having too old a version of stdatamodels installed caused this.

If stdatamodels is not installed at all, no error will be raised.

@PaulHuwe
Copy link
Collaborator

PaulHuwe commented Mar 8, 2023

Details

After some further investigation, I figured it out. With an unsupported version of stdatamodels installed, tox would work, but pytest would fail with what I pasted above. Romancal installs stdatamodels via the stpipe dependency.

When I installed the development version of stdatamodels, things worked fine.

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.

With dev stdatamodels, this passes all romancal unit and regression tests.

@hbushouse hbushouse added this to the 1.4.0 milestone Mar 9, 2023
Copy link
Collaborator

@hbushouse hbushouse left a comment

Choose a reason for hiding this comment

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

Do we need a new release of stdatamodels before a new release of stcal?

@WilliamJamieson
Copy link
Collaborator Author

Do we need a new release of stdatamodels before a new release of stcal?

Yes

This is being moved to stdatamodels
@WilliamJamieson WilliamJamieson force-pushed the refactor/move_dq_to_stdatamodels branch from 245fff9 to 038bd07 Compare March 14, 2023 13:53
@hbushouse
Copy link
Collaborator

Is there a way to get the 3 queued CI tests to start?

@WilliamJamieson
Copy link
Collaborator Author

Is there a way to get the 3 queued CI tests to start?

Short answer is no, the spacetelescope organization has a very limited number of macos runners, so if lots of PRs in spacetelescope are made, those can get really backed up.

I'm not sure why we have so many macos jobs across all our CI. In general you only really need one to make sure we aren't making assumptions that macos cannot handle, not one on every single version of python.

@zacharyburnett can provide more information.

@zacharyburnett
Copy link
Collaborator

Is there a way to get the 3 queued CI tests to start?

Short answer is no, the spacetelescope organization has a very limited number of macos runners, so if lots of PRs in spacetelescope are made, those can get really backed up.

I'm not sure why we have so many macos jobs across all our CI. In general you only really need one to make sure we aren't making assumptions that macos cannot handle, not one on every single version of python.

@zacharyburnett can provide more information.

That's a fair point; I added macos jobs for thoroughness but you're right, we have limited resources available for free. If you guys are okay with it, I can make some PRs removing macos jobs for Python versions less than latest across the organization.

@WilliamJamieson
Copy link
Collaborator Author

That's a fair point; I added macos jobs for thoroughness but you're right, we have limited resources available for free.

"free" is a strong statement, I don't know exactly how STScI has structured the org, but in general an organization only gets so many minutes of action time per month before they start having to pay for it, see https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions for more details.
Note also that macOS actions have a 10x multiplier on their run time to get how many minutes they cost.

@hbushouse
Copy link
Collaborator

Well, at this point I'm satisfied that this works OK and hence am willing to merge without waiting for those remaining CI tests to complete. @WilliamJamieson you're hereby authorized to merge.

@WilliamJamieson
Copy link
Collaborator Author

Well, at this point I'm satisfied that this works OK and hence am willing to merge without waiting for those remaining CI tests to complete. @WilliamJamieson you're hereby authorized to merge.

I would love to but I don't have the rights in stcal to merge things if the branch protections have not passed. So I'll just set the automerge, and it will merge when the protections pass.

@kmacdonald-stsci might be able to override the protections.

@WilliamJamieson WilliamJamieson enabled auto-merge (squash) March 14, 2023 15:07
@hbushouse
Copy link
Collaborator

Well, at this point I'm satisfied that this works OK and hence am willing to merge without waiting for those remaining CI tests to complete. @WilliamJamieson you're hereby authorized to merge.

I would love to but I don't have the rights in stcal to merge things if the branch protections have not passed. So I'll just set the automerge, and it will merge when the protections pass.

@kmacdonald-stsci might be able to override the protections.

I have the power. Merging now.

@hbushouse hbushouse disabled auto-merge March 14, 2023 15:08
@hbushouse hbushouse merged commit 4e6df94 into spacetelescope:main Mar 14, 2023
@WilliamJamieson WilliamJamieson deleted the refactor/move_dq_to_stdatamodels branch March 14, 2023 15:08
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.

5 participants