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

update compare_asdf to use tolerance in more comparisons #917

Merged
merged 2 commits into from
Oct 2, 2023

Conversation

braingram
Copy link
Collaborator

@braingram braingram commented Oct 2, 2023

Provide atol to DeepDiff as math_epsilon argument to allow tolerancing scalar comparisons.

Drop use of astropy.utils.diff.values_differ as it does not provide readable output and does not allow control of nan equality. Instead, convert the table to a numpy structured array during comparison.

Add support for numpy structured array comparison.

Fixes #916

Checklist

  • added entry in CHANGES.rst under the corresponding subsection
  • updated relevant tests
  • updated relevant documentation
  • updated relevant milestone(s)
  • added relevant label(s)
  • ran regression tests, post a link to the Jenkins job below. How to run regression tests on a PR

Regression tests running at: https://plwishmaster.stsci.edu:8081/job/RT/job/Roman-Developers-Pull-Requests/395/
Regression tests are failing due to unavailable webbpsf data. #918 fixes the issue for the regression tests.
EDIT: the url used to fetch the data appears to be back up (for now, box is having issues), a new run passed with no errors: https://plwishmaster.stsci.edu:8081/blue/organizations/jenkins/RT%2FRoman-Developers-Pull-Requests/detail/Roman-Developers-Pull-Requests/397/pipeline

Provide ``atol`` to ``DeepDiff`` as ``math_epsilon`` argument
to allow tolerancing scalar comparisons.

Drop use of ``astropy.utils.diff.values_differ`` as it does
not provide readable output and does not allow control
of ``nan`` equality. Instead, convert the table to a numpy
structured array during comparison.

Add support for numpy structured array comparison.
@braingram braingram marked this pull request as ready for review October 2, 2023 16:49
@braingram braingram requested a review from a team as a code owner October 2, 2023 16:49
@codecov
Copy link

codecov bot commented Oct 2, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Files Coverage Δ
romancal/regtest/regtestdata.py 65.30% <94.11%> (+1.83%) ⬆️

📢 Thoughts on this report? Let us know!.

Copy link
Collaborator

@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! Thanks again, @braingram!

@mairanteodoro mairanteodoro merged commit b7f796c into spacetelescope:main Oct 2, 2023
@braingram braingram deleted the math_epsilon branch October 2, 2023 19:28
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.

Improve readability of Table comparison with compare_asdf.
2 participants