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

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

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 48.29545% with 455 lines in your changes missing coverage. Please review.

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

Files with missing lines Patch % Lines
src/stcal/skymatch/skyimage.py 42.75% 316 Missing ⚠️
src/stcal/skymatch/skymatch.py 54.21% 125 Missing ⚠️
src/stcal/skymatch/skystatistics.py 72.54% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #310      +/-   ##
==========================================
- Coverage   82.57%   79.42%   -3.16%     
==========================================
  Files          57       61       +4     
  Lines       10272    11241     +969     
==========================================
+ Hits         8482     8928     +446     
- Misses       1790     2313     +523     

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

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

src/stcal/skymatch/skyimage.py Outdated Show resolved Hide resolved
Comment on lines +161 to +152
The functionality to support this conversion is not yet
implemented and at this moment `convf` is ignored.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are there plans to implement this? If not, perhaps now is a good time to remove the option

Copy link
Member

Choose a reason for hiding this comment

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

Based on ancient (>9 years old) discussions with relevant people, this feature, in theory, may not be needed for JWST. In practice, however, we don't know. I suggest leaving this alone as is.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is actually being used in places

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you please point me to where? If that's the case, this comment in the docstring should be removed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thats all logging but I'm not qualified to tell if we want to keep any parts of those logs

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think "used in logging" qualifies as being used given that convf is hard-coded to equal 1.0 and therefore has no effect on the scaling reported in the log messages. So I agree with Mihai we should leave this as-is, including the docstring

src/stcal/skymatch/skyimage.py Outdated Show resolved Hide resolved
src/stcal/skymatch/skyimage.py Outdated Show resolved Hide resolved
src/stcal/skymatch/skyimage.py Show resolved Hide resolved
src/stcal/skymatch/skymatch.py Outdated Show resolved Hide resolved
src/stcal/skymatch/skystatistics.py Outdated Show resolved Hide resolved
src/stcal/skymatch/skystatistics.py Outdated Show resolved Hide resolved
@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
@WilliamJamieson WilliamJamieson force-pushed the feature/move_skymatch branch 3 times, most recently from 96da6e5 to 46a88e2 Compare February 11, 2025 22:10
src/stcal/skymatch/skyimage.py Outdated Show resolved Hide resolved
src/stcal/skymatch/skyimage.py Outdated Show resolved Hide resolved
@WilliamJamieson WilliamJamieson force-pushed the feature/move_skymatch branch 2 times, most recently from b5c4516 to d0976cb Compare February 11, 2025 22:24
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.

Thanks for all the updates! Before merging I think it would be good to update spacetelescope/jwst#8901 such that we can see if the changes are likely to work well with jwst. Perhaps you were already planning to do so.

@WilliamJamieson
Copy link
Collaborator Author

Thanks for all the updates! Before merging I think it would be good to update spacetelescope/jwst#8901 such that we can see if the changes are likely to work well with jwst. Perhaps you were already planning to do so.

I am not finished updating everything yet.

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

docs/conf.py Outdated
Comment on lines 49 to 50
("py:class", "stsci.imagestats.ImageStats"), # intersphinx isn't working here
("py:class", "spherical_geometry.polygon.SphericalPolygon"), # intersphinx isn't working here
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These should be working with the intersphinx links I added. I believe the fix may require some fixes in the documentation for those packages.

It is possible something is off in the stcal docs causing the link failure. Please feel free to push changes to attempt to fix this.

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

4 participants