-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Moving function quantity_allclose #7235 #7252
Merged
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
6b26606
Moved function quantity_allclose to astropy.units.quantity
rohanrajpal 77d278d
respond to comments
Cadair f69fb8c
add isclose as well, because I want it
Cadair 82a8d21
just import quantity_allclose into helper
Cadair 5882cb4
Remilestone to 3.0.2
drdavella ba9774e
various fixes and improvements
Cadair a573d23
DOC: Fix Sphinx warnings [docs only]
pllim 2e0f6d3
Added doc, tests, change log text.
pllim ac6ead4
DOC: Skip doctest on bool array
pllim e377e93
Restore API compatibility since this is a bugfix
drdavella 26d5224
Workaround to preserve API compatibility and sphinx build for bugfix
drdavella e7f38f6
Address review comment for assert_quantity_allclose
pllim File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ | |
except ImportError: | ||
pass | ||
|
||
from ..units import allclose as _quantity_allclose # noqa | ||
from ..units import allclose as _quantity_allclose | ||
from ..utils.exceptions import (AstropyDeprecationWarning, | ||
AstropyPendingDeprecationWarning) | ||
|
||
|
@@ -459,12 +459,7 @@ def assert_quantity_allclose(actual, desired, rtol=1.e-7, atol=None, | |
This is a :class:`~astropy.units.Quantity`-aware version of | ||
:func:`numpy.testing.assert_allclose`. | ||
""" | ||
import numpy as np | ||
from astropy.units.quantity import _unquantify_allclose_arguments | ||
|
||
np.testing.assert_allclose(*_unquantify_allclose_arguments(actual, desired, | ||
rtol, atol), | ||
**kwargs) | ||
assert _quantity_allclose(actual, desired, rtol=rtol, atol=atol, **kwargs) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @astrofrog , like this, correct? |
||
|
||
# TODO: This is a workaround to preserve API compatibility for the bugfix | ||
def quantity_allclose(*args, **kwargs): | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It seems this line, which was reinstated because of a comment by @mhvk got deleted again in the sphinx fixes. @pllim can we put this back in your second PR, to fix @cdeil's problem?
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.
Ops. I only saw Tom's comment. Sorry. I'll fix this shortly.