-
Notifications
You must be signed in to change notification settings - Fork 349
Add NaN check to prevent raising a false relativity error #1681
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
Conversation
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
PR adds new behavior
Codecov Report
@@ Coverage Diff @@
## main #1681 +/- ##
==========================================
+ Coverage 97.21% 97.23% +0.02%
==========================================
Files 83 85 +2
Lines 7961 8020 +59
==========================================
+ Hits 7739 7798 +59
Misses 222 222
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At a first, early-morning and insufficiently-caffeinated glance (so I might be way off!), it doesn't look like this change will do the trick... Which is why it'd be great to add some tests here, to convince even the most sleepy maintainer ;) ! You can find some inspiration in the ones I listed at #1672 (comment) :)
It works on my machine and passes the suggested tests (51ee531). Maybe I am missing something... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for submitting this pull request! This is definitely going to make my life easier in #1539, so I very much appreciate it!
I added some minor suggestions related to formatting and test organization. Overall it looks good and we should be able to merge this pretty soon.
Thank you again!
Co-authored-by: Nick Murphy <namurphy@cfa.harvard.edu>
Co-authored-by: Nick Murphy <namurphy@cfa.harvard.edu>
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At a first, early-morning and insufficiently-caffeinated glance (so I might be way off!), it doesn't look like this change will do the trick... Which is why it'd be great to add some tests here, to convince even the most sleepy maintainer ;) ! You can find some inspiration in the ones I listed at #1672 (comment) :)
@StanczakDominik it appears to work properly and passes all tests. No changes necessary to the new code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, since it passes the tests, I'm a-okay with it! Sorry for the confusion earlier!
As recommended by @StanczakDominik in PlasmaPy#1681 (comment)
This PR adds an additional check in
plasmapy.formulary.relativity.Lorentz_factor
to prevent input ofnp.nan
from raisingutils.RelativityError
. Closes #1672.I have added a changelog entry for this pull request.
If adding new functionality, I have added tests and
docstrings.
I have fixed any newly failing tests.