8000 Pull common parts of skymatch from romancal and jwst into stcal by WilliamJamieson · Pull Request #310 · spacetelescope/stcal · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Pull common parts of skymatch from romancal and jwst into stcal #310

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

Merged

Conversation

WilliamJamieson
Copy link
Collaborator
@WilliamJamieson WilliamJamieson commented Oct 17, 2024

This PR pulls the common parts of skymatch from romancal and jwst into stcal to be shared.

Note, no tests are included because it is well tested by the step tests in both romancal and jwst.

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 17, 2024

Codecov Report

Attention: Patch coverage is 68.11146% with 309 lines in your changes missing coverage. Please review.

Project coverage is 85.00%. Comparing base (5bbdaa1) to head (1801b3a).
Report is 121 commits behind head on main.

Files with missing lines Patch % Lines
src/stcal/skymatch/skyimage.py 58.65% 246 Missing ⚠️
src/stcal/skymatch/skymatch.py 81.73% 57 Missing ⚠️
src/stcal/skymatch/skystatistics.py 89.65% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #310      +/-   ##
==========================================
- Coverage   86.98%   85.00%   -1.98%     
==========================================
  Files          57       61       +4     
  Lines       10272    11367    +1095     
==========================================
+ Hits         8935     9663     +728     
- Misses       1337     1704     +367     

☔ 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.

Copy link
Collaborator
@emolter emolter 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 great, thanks William! I just had a few questions about whether some of the ruff and mypy problems could be fixed instead of ignored.

I also had a few questions about the code itself, but those also exist on jwst main, so they're technically beyond the scope of this PR. But I'm still curious to know the answers to those and I figure now is as good a time as any to ensure the code is written as cleanly as possible

@WilliamJamieson
Copy link
Collaborator Author

This looks great, thanks William! I just had a few questions about whether some of the ruff and mypy problems could be fixed instead of ignored.

I also had a few questions about the code itself, but those also exist on jwst main, so they're technically beyond the scope of this PR. But I'm still curious to know the answers to those and I figure now is as good a time as any to ensure the code is written as cleanly as possible

I agree they should be fixed. However, as you said they are beyond the scope of this PR. I think for making it possible to trace the history of changes it makes sense to move the code in as close a state as possible from JWST to stcal and then do a follow on PR making cleanups and addressing the issues uncovered here.

@emolter
Copy link
Collaborator
emolter commented Jan 13, 2025

I agree they should be fixed. However, as you said they are beyond the scope of this PR.

IMO making the code adhere to the more stringent style rules in stcal remains within the scope. I don't much like ignoring them. I think the downstream testing should assuage any concerns that those changes might break something.

I agree that my comment RE the potentially unnecessary use of @property can be ignored for now though.

@WilliamJamieson WilliamJamieson force-pushed the feature/move_skymatch branch 6 times, most recently from eb4b7d8 to 2e6b1c9 Compare February 11, 2025 22:02
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Feb 12, 2025
@WilliamJamieson
Copy link
Collaborator Author

@emolter I believe this is ready now.

Copy link
Collaborator
@emolter emolter left a comment

Choose a reason for hiding this comment

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

All my previous questions have been answered now.

I don't think the changes have been so large that it would be helpful for me to go through it again, but let me know if you'd like me to.

So this looks good to me pending fixing the bug that is causing the failing jwst regtests

@WilliamJamieson WilliamJamieson force-pushed the feature/move_skymatch branch 2 times, most recently from dbcfe42 to ba04e8e Compare February 14, 2025 17:42
This is from jwst commit 2491b40a25f42bf2c10d242178434fe6c7d75847
@mcara
Copy link
Member
mcara commented Feb 16, 2025

It would still be useful to have some unit tests developed for this. We have always relied on regression tests (both for HST and JWST) but PRs to this code in the future should be able to use some quick unit tests. It could be done either as part of this PR or as a follow-up PR.

@WilliamJamieson
Copy link
Collaborator Author

It would still be useful to have some unit tests developed for this. We have always relied on regression tests (both for HST and JWST) but PRs to this code in the future should be able to use some quick unit tests. It could be done either as part of this PR or as a follow-up PR.

I think this should be a follow on PR. I looked into moving some of the unit tests from JWST. But at this time all those tests directly involve running the entire skymatch step. I personally don't feel like I can write any useful unit tests for this part of skymatch independent of JWST at this time.

@nden nden dismissed emolter’s stale review February 17, 2025 16:05

@emolter I'm dismissing the request for changes since jwst tests are passing now and you approved otherwise.

@emolter
Copy link
Collaborator
emolter commented Feb 17, 2025

Thanks @nden, that's fine with me. As I said, I'll only look at this again if needed, @WilliamJamieson I see you re-requested my review after @nden dismissed the stale one. Does that mean you'd like me to look again, or would you just like me to hit the Approve button?

@emolter
Copy link
Collaborator
emolter commented Feb 17, 2025

General semi-related question: how much work is left to do in order to move all shared WCS-related functions out of JWST/Romancal and into stcal? Last time I checked, there are several functions with same/similar names and/or same functionality but different names that have multiple versions in the various repositories. It occurs to me that we could have perhaps avoided the confusion caused by these regression test failures if everyone was calling the best and most up-to-date versions of these functions from stcal. I'm talking about functions that should/already do live in stcal.alignment.util.

Even within stcal there are repeats, e.g. a reproject(wcs1,wcs2) function in both stcal.alignment.util and stcal.outlier_detection.utils.

Is this something we want to clean up in the near future? Should I make an issue/ticket about this? Does it already exist?

@WilliamJamieson
Copy link
Collaborator Author

Thanks @nden, that's fine with me. As I said, I'll only look at this again if needed, @WilliamJamieson I see you re-requested my review after @nden dismissed the stale one. Does that mean you'd like me to look again, or would you just like me to hit the Approve button?

If you want to do another full review your welcome, though there hasn't been any substantive changes since I addressed your last one. In any case, in order for me to merge this PR I do need two approving reviews.

@nden
Copy link
Collaborator
nden commented Feb 17, 2025

@schlafly @ddavis-stsci This is ready to be merged from JWSt point of view. Romancal unit tests are passing and a PR using this code is in the works for Roman.. Please review when available.

@WilliamJamieson WilliamJamieson merged commit 95c1d8f into spacetelescope:main Feb 17, 2025
24 of 26 checks passed
@WilliamJamieson WilliamJamieson deleted the feature/move_skymatch branch February 17, 2025 17:09
@tapastro
Copy link
Collaborator

This was waiting for a Roman team member to approve - in general, stcal PRs require approvals not just from any two people, but one from jwst and one from Roman. This still needs eyes from the Roman team.

We can make this procedure more clear to the branch.

@WilliamJamieson
Copy link
Collaborator Author

This was waiting for a Roman team member to approve - in general, stcal PRs require approvals not just from any two people, but one from jwst and one from Roman. This still needs eyes from the Roman team.

We can make this procedure more clear to the branch.

I have been tracking this for both JWST and RCAL. JWST was the main sticking point with RCAL waiting for this to go in.

@tapastro
Copy link
Collaborator

Eddie, the Romancal product owner, listed himself and Dave Davis as approved reviewers for stcal PRs. He is free to add you to that list, but I have not heard of an update there and am trying to follow protocol so that we do not merge changes that Romancal is not aware of.

@schlafly
Copy link
Collaborator

Thanks. I'm happy for this to go in.

I'll note that I got confused trying to understand how the "self.sky" feature was supposed to function in the SkyGroups, and where or how the image.backgrounds are used.
https://github.com/spacetelescope/stcal/pull/310/files#diff-1d5ed0c79f81a6487ae90d08de3bf1b263bb11b97aa1aee2175b28918a78f7b3R731
https://github.com/spacetelescope/stcal/pull/310/files#diff-1d5ed0c79f81a6487ae90d08de3bf1b263bb11b97aa1aee2175b28918a78f7b3R813

I'm sure I just missed it, though, and presumably it is duplicating existing code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation installation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants
0