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

Change warning type for some kernels. Add unit tests for flux conservation #141

Merged
merged 3 commits into from
Feb 23, 2024

Conversation

mcara
Copy link
Member

@mcara mcara commented Feb 19, 2024

This PR adds unit tests that verify that "square", "turbo", and "point" kernels do conserve flux.

It also modifies the warning type for the "non flux conserving" kernels from DeprecationWarning to Warning.

@mcara mcara added the testing label Feb 19, 2024
@mcara mcara self-assigned this Feb 19, 2024
@mcara mcara requested a review from a team as a code owner February 19, 2024 07:22
@mcara mcara requested a review from nden February 19, 2024 07:22
Copy link

codecov bot commented Feb 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.29%. Comparing base (0104065) to head (27496e4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #141   +/-   ##
=======================================
  Coverage   75.29%   75.29%           
=======================================
  Files           7        7           
  Lines         344      344           
=======================================
  Hits          259      259           
  Misses         85       85           

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

Copy link

@mairanteodoro mairanteodoro left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Copy link
Contributor

@nden nden left a comment

Choose a reason for hiding this comment

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

What happens with the tophat kernel now? I lost track.

)

@pytest.mark.parametrize(
'kernel,conserves',
Copy link
Contributor

Choose a reason for hiding this comment

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

Is conserves used anywhere? Am I missing it?

Copy link
Member Author

@mcara mcara Feb 23, 2024

Choose a reason for hiding this comment

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

good observation. Initially, I was thinking of a different way to design the test but then decided to go with pytest.mark.xfail for non-conserving kernels. Fixed in the next commit

),
],
)
def test_flux_conservation_distorted(kernel, conserves):
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question here

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@mcara
Copy link
Member Author

mcara commented Feb 23, 2024

What happens with the tophat kernel now? I lost track.

Nothing for now. It was deprecated in #140. This PR simply adds unit tests to test flux (non-)conservation.

@mcara mcara merged commit c27439d into spacetelescope:main Feb 23, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants