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
Conversation
Hi there @rohanrajpal 👋 - thanks for the pull request! I'm just a friendly 🤖 that checks for issues related to the changelog and making sure that this pull request is milestoned and labeled correctly. This is mainly intended for the maintainers, so if you are not a maintainer you can ignore this, and a maintainer will let you know if any action is required on your part 😃. Everything looks good from my point of view! 👍 If there are any issues with this message, please report them 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.
Some comments below. Please also add a change log for 3.1 under "API changes" (see other entries for formatting).
astropy/tests/helper.py
Outdated
@@ -465,7 +464,7 @@ def assert_quantity_allclose(actual, desired, rtol=1.e-7, atol=None, | |||
rtol, atol), | |||
**kwargs) | |||
|
|||
|
|||
@deprecated("3.1.dev21533") |
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.
- Just "3.1" is sufficient.
- Please provide a string to explain where it has moved to.
- To avoid code duplication, this function now should only have one functional line of code to just call the new one.
astropy/tests/helper.py
Outdated
@@ -3,14 +3,13 @@ | |||
This module provides the tools used to internally run the astropy test suite | |||
from the installed astropy. It makes use of the `pytest` testing framework. | |||
""" | |||
|
|||
from ..utils.decorators import deprecated |
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.
Please move local import to after import pytest
.
astropy/units/quantity.py
Outdated
@@ -8,6 +8,7 @@ | |||
|
|||
|
|||
# Standard library | |||
|
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.
Please remove extra line here.
astropy/units/quantity.py
Outdated
@@ -107,7 +117,6 @@ def __next__(self): | |||
|
|||
next = __next__ | |||
|
|||
|
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.
There should be 2 lines between classes and functions. Please fix PEP8 warnings reported at https://travis-ci.org/astropy/astropy/jobs/348076730 (I just restarted the job because Travis has problem displaying the log).
This is a :class:`~astropy.units.Quantity`-aware version of | ||
:func:`numpy.allclose`. | ||
""" | ||
return np.allclose(*_unquantify_allclose_arguments(a, b, rtol, atol), |
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.
@mhvk , should _unquantify_allclose_arguments
be moved over too? (Since this is a "hidden" function, I don't think deprecation would be necessary if we decide to move it.)
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.
Surely without moving that over astropy.units.quantity
now has an import dependency on pytest?!
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.
Yes, _unquantity_allclose_arguments
definitely needs to be moved 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.
@mhvk And the name _unquantity_allclose_arguments
shall remain the same or changed like allclose
?
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.
I think the name is fine as is -- and it is a private function anyway, so we can change it later if needed.
astropy/units/quantity.py
Outdated
@@ -687,6 +696,7 @@ def _result_as_quantity(self, result, unit, out): | |||
out._set_unit(unit) | |||
return out | |||
|
|||
|
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.
Remove extra line.
astropy/utils/decorators.py
Outdated
@@ -115,7 +115,7 @@ def deprecated_func(*args, **kwargs): | |||
category = AstropyDeprecationWarning | |||
|
|||
warnings.warn(message, category, stacklevel=2) | |||
|
|||
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.
Please have your editor set to remove extraneous whitespace like this.
astropy/units/quantity.py
Outdated
@@ -39,6 +39,15 @@ | |||
_UNIT_NOT_INITIALISED = "(Unit not initialised)" | |||
_UFUNCS_FILTER_WARNINGS = {np.arcsin, np.arccos, np.arccosh, np.arctanh} | |||
|
|||
def quantity_allclose(a, b, rtol=1.e-5, atol=None, **kwargs): |
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.
I would vote for this just being called allclose
as it's in units.quantity
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.
Agreed. It should also be added to __all__
, so that it is exposed as u.allclose()
.
Aside: needs an extra empty line above the function definition (pep8)
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.
After going through units.quantity
all the attributes of all.All of them are classes which have functions inside them, so I have to do the same?
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.
No, this would remain a function - it is just a coincidence that in this module only classes are exported.
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 we're slowly converging. What remains to be done:
- Change all occurrences of
quantity_allclose
in the code base (probably mostly in test files, but check). - Look for a good place in
docs/units
to mention the function (not in "getting started", probably).
CHANGES.rst
Outdated
@@ -61,6 +61,7 @@ astropy.table | |||
|
|||
astropy.tests | |||
^^^^^^^^^^^^^ | |||
-Deprecated function ``quantity``allclose to helper |
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.
Formatting is wrong (see elsewhere in fine). Also, this is not very helpful to someone who is reading this. Write
The function ``quantity_allclose`` was moved to the ``units`` package with the new,
shorter name ``allclose``. It is deprecated in ``tests``. [#7252]
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.
The comments about the changelog should still be addressed.
CHANGES.rst
Outdated
@@ -71,7 +72,7 @@ astropy.time | |||
|
|||
astropy.units | |||
^^^^^^^^^^^^^ | |||
|
|||
-Added function ``quantity``allclose to quantity |
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.
Again, formatting is wrong (need space and empty line after, plus link to PR), and the description is too terse to be useful:
Added a units-aware ``allclose`` function (this was previously available in the
``tests`` module as ``quantity_allclose``) [#7252]
astropy/tests/helper.py
Outdated
@@ -465,17 +464,16 @@ def assert_quantity_allclose(actual, desired, rtol=1.e-7, atol=None, | |||
rtol, atol), | |||
**kwargs) | |||
|
|||
|
|||
@deprecated("3.1","moved function to astropy.units.quantity") |
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.
This is not a helpful message. I think we can just use alternative
instead of the message
argument, as in alternative='astropy.units.allclose'
astropy/tests/helper.py
Outdated
import numpy as np | ||
return np.allclose(*_unquantify_allclose_arguments(a, b, rtol, atol), | ||
**kwargs) | ||
from ..units.quantity import quantity_allclose as quantity_allclose_units |
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.
I think we seem to have reached agreement to call it allclose
in units
astropy/units/quantity.py
Outdated
@@ -39,6 +39,15 @@ | |||
_UNIT_NOT_INITIALISED = "(Unit not initialised)" | |||
_UFUNCS_FILTER_WARNINGS = {np.arcsin, np.arccos, np.arccosh, np.arctanh} | |||
|
|||
def quantity_allclose(a, b, rtol=1.e-5, atol=None, **kwargs): |
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.
Agreed. It should also be added to __all__
, so that it is exposed as u.allclose()
.
Aside: needs an extra empty line above the function definition (pep8)
astropy/units/quantity.py
Outdated
""" | ||
Returns True if two arrays are element-wise equal within a tolerance. | ||
|
||
This is a :class:`~astropy.units.Quantity`-aware version of |
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.
Now that we are making this a much more visible function, it should have a proper docstring, defining the arguments, etc. See developer documentation (and other examples in code) for details on how this looks. This particular sentence would go under "Notes"
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.
That means _unquantify_allclose_arguments
shall also have a proper docstring,right?
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 remains a private function and it is pretty obvious what it does, so I don't think it is essential, but feel free to add something short.
This is a :class:`~astropy.units.Quantity`-aware version of | ||
:func:`numpy.allclose`. | ||
""" | ||
return np.allclose(*_unquantify_allclose_arguments(a, b, rtol, atol), |
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.
Yes, _unquantity_allclose_arguments
definitely needs to be moved here.
Okay @mhvk
|
@rohanrajpal - Just do the following:
Note that it is fine to change not the tests themselves but just the import, as in:
And the deprecation warnings will tell you whether you missed anything. |
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.
Thought I might as well review...
astropy/tests/helper.py
Outdated
|
||
@deprecated("3.1",alternative='astropy.units._unquantify_allclose_arguments') |
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.
This one doesn't have to be deprecated - it is a private function. However, you do need to import it inside assert_quantity_allclose
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.
Okay, but I do have to make a call to the new location of the function, in order to avoid code duplication.
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.
That why I noted that you have to import it in assert_quantity_allclose
CHANGES.rst
Outdated
@@ -61,6 +61,7 @@ astropy.table | |||
|
|||
astropy.tests | |||
^^^^^^^^^^^^^ | |||
-Deprecated function ``quantity``allclose to helper |
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.
The comments about the changelog should still be addressed.
astropy/units/quantity.py
Outdated
@@ -30,7 +30,7 @@ | |||
check_output) | |||
|
|||
__all__ = ["Quantity", "SpecificTypeQuantity", | |||
"QuantityInfoBase", "QuantityInfo"] | |||
"QuantityInfoBase", "QuantityInfo","allclose"] |
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.
Space after ,
- please follow pep8.
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.
My bad, I'll be careful now
astropy/units/quantity.py
Outdated
@@ -40,6 +40,52 @@ | |||
_UFUNCS_FILTER_WARNINGS = {np.arcsin, np.arccos, np.arccosh, np.arctanh} | |||
|
|||
|
|||
def allclose(a, b, rtol=1.e-5, atol=None, **kwargs): |
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.
This is a bit of a detail, but this function is not as important as the Quantity
class - I would suggest moving it to the end of the file (with _unquantify_allclose_arguments
)
astropy/units/quantity.py
Outdated
@@ -841,7 +887,7 @@ def to(self, unit, equivalencies=[]): | |||
-------- | |||
to_value : get the numerical value in a given unit. | |||
""" | |||
# We don't use `to_value` below since we always want to make a copy | |||
# We don't use `to_value` below since we always want to make a Copy |
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.
Why this change? Just keep as is.
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.
My bad have fixed this in the recent pull request
@mhvk can you review it?
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.
I still see a change here. Can you undo it?
I've tried to make all the changes following pep8, I've noticed the pep8 error |
Indeed, long lines are ignored by default (though it is good to stick to it). |
CHANGES.rst
Outdated
- The function ``quantity_allclose`` was moved to the ``units`` package with the new, | ||
shorter name ``allclose``. It is deprecated in ``tests``. [#7252] | ||
|
||
- The function ``_unquantify_allclose_arguments`` was moved to the ``units`` package. It is deprecated in ``tests``. [#7252] |
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.
This is a private function, so we should not advertise it in any way (i.e., just remove this from the changelog).
CHANGES.rst
Outdated
- Added a units-aware ``allclose`` function (this was previously available in the | ||
``tests`` module as ``quantity_allclose``) [#7252] | ||
|
||
- Added a units-aware ``_unquantify_allclose_arguments`` function (this was previously available in the |
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.
As above - remove this from the changelog.
@@ -5,7 +5,7 @@ | |||
|
|||
import numpy as np | |||
|
|||
from ....tests.helper import quantity_allclose | |||
from ....units.quantity import allclose as quantity_allclose |
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.
Total nitpick, but typically we import from as high a level as possible, so from ....units import ...
(same for other files).
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.
Could you give a complete example? I'm getting a value error by importing with that method.Probably making a silly mistake.
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.
from ....units import allclose as quantity_allclose
I hope this solves it; if not, please do debug yourself - this is taking me more time to answer than it should take you to solve.
@@ -17,11 +17,11 @@ | |||
from numpy.random import randn | |||
from numpy import testing as npt | |||
|
|||
from ...tests.helper import (raises, quantity_allclose as allclose, | |||
assert_quantity_allclose as assert_allclose) | |||
from ...tests.helper import (raises, assert_quantity_allclose as assert_allclose) |
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.
parentheses can go now...
@@ -9,11 +9,10 @@ | |||
from ..builtin_frames import (ICRS, FK5, FK4, FK4NoETerms, Galactic, | |||
Supergalactic, Galactocentric, HCRS, GCRS, LSR) | |||
from .. import SkyCoord | |||
from ...tests.helper import (quantity_allclose as allclose, | |||
assert_quantity_allclose as assert_allclose) | |||
from ...tests.helper import (assert_quantity_allclose as assert_allclose) |
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.
Remove parentheses
@@ -11,8 +11,9 @@ | |||
from .. import representation as r | |||
from ..baseframe import frame_transform_graph | |||
from ...tests.helper import (assert_quantity_allclose as assert_allclose, | |||
quantity_allclose, catch_warnings) | |||
catch_warnings) |
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.
Not aligned properly
astropy/tests/helper.py
Outdated
import pytest | ||
from ..utils.decorators import deprecated |
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.
As I'm nitpicking anyway, an open line before this statement (separating standard library from our own 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.
Remove this since it isn't used.
astropy/tests/helper.py
Outdated
return np.allclose(*_unquantify_allclose_arguments(a, b, rtol, atol), | ||
**kwargs) | ||
from ..units.quantity import allclose as quantity_allclose_units | ||
quantity_allclose_units(a, b, rtol=1.e-5, atol=None, **kwargs) | ||
|
||
|
||
def _unquantify_allclose_arguments(actual, desired, rtol, atol): |
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.
This one should be removed altogether. Nobody should be relying on this private routine.
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.
You mean to remove the function quantity_allclose
altogether?
Shouldn't a deprecated function call to the new location of the function?
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.
No, please look where the comment is made: you should remove _unquantity_allclose_arguments
from utils
-- it is a private function, so no deprecation is needed.
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.
You meant to remove from units
not utils
, right? If you do mean units, isn't that the place I moved the function _unquantity_allclose_arguments
to?Also, this comment is made in tests/helper.py.Should I remove it from helper
as well or keep it as it is.
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.
I meant utils
- you moved _unquantity_allclose_arguments
to units
and there is no reason to keep it here, as you import it directly from units in assert_quantity_allclose
.
astropy/units/quantity.py
Outdated
|
||
|
||
def _unquantify_allclose_arguments(actual, desired, rtol, atol): | ||
from .. import units as u |
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.
We are inside units
here, so no need for this import; just change u.Quantity
-> Quantity
below (and same for UnitsError
)
Quite a few nitpicks, but also some more substantial comments. While you are at it, could you also rebase & squash the commits. And of course please check the test failures (much easier if you run tests locally first to ensure things are OK). |
I'm personally -1 on deprecating the old location (as in, I don't think we should raise a deprecation warning yet, but just silently allow it to work). This is a function that I've actually used in quite a few packages and I suspect others may have too, and it's one of these cases where it's not clear that deprecating it is actually necessary and is going to be a pain for affiliated package maintainers. I've been wanting for a while to write some kind of APE along these lines, but I don't think we always need to systematically emit deprecation warnings for old behavior (which then trigger CI failures) if keeping the old behavior isn't a burden (which it wouldn't be here). We should be striving for stability not purity, and this PR as-is is going to require affiliated package developers to have four lines (a try...except) to import this function instead of one now in order to support the current LTS and latest version. TL;DR I think we should only deprecate things when they become a burden to maintain in astropy dev. |
@astrofrog - OK, that makes sense to me as well. Just so we don't get another cycle
and not define a deprecated |
@astrofrog , can't we still use it but just set |
I'm sorry the recent pull request was made by mistake while trying to rebase and squash. |
@mhvk , I did a review and addressed your remaining concerns (missing doc and tests). Please have a look. If tests are passing now and you are satisfied, feel free to merge. |
docs/units/quantity.rst
Outdated
>>> u.allclose([1, 2] * u.m, [100, 200] * u.cm) | ||
True | ||
>>> u.isclose([1, 2] * u.m, [100, 20] * u.cm) | ||
array([ True, False]) |
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.
This is one of the annoying things that changed in recent numpy (and thus doesn't work across versions), that in numpy <=1.13, this has ", dtype=bool" appended; maybe just doctest: +SKIP
...
This is because formatting is different across Numpy versions. [docs only]
astropy/tests/helper.py
Outdated
@@ -30,7 +29,7 @@ | |||
|
|||
__all__ = ['raises', 'enable_deprecations_as_exceptions', 'remote_data', | |||
'treat_deprecations_as_exceptions', 'catch_warnings', | |||
'assert_follows_unicode_guidelines', 'quantity_allclose', |
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.
Can we do this on a bugfix branch? While importing with *
is bad practice, this removal is an API change for those who do that.
As @astrofrog commented above (#7252 (review)), we need to remove this function for the |
@bsipocz and @drdavella , adding it back in |
You could always just use this as the master fix and then use my other PR as the backport. Completely removes any API change in the bugfix then. |
(for @bsipocz we could merge that PR first and then revert the commit in this one) 😉 |
@pllim - Yes, that's a good point, and I'm not comfortable with breaking sphinx either (but somehow missed that it happened already). Probably the simplest is to add it back either during the backport (either as part of this or a separate commit), or in a PR directly opened to 2.0.x once this one is backported. |
astropy/tests/helper.py
Outdated
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 comment
The reason will be displayed to describe this comment to others. Learn more.
@astrofrog , like this, correct?
🐴 💀 |
(I'll open a follow-up PR about that |
Thanks everyone! |
This PR broke some tests we have in Gammapy that call Example:
I will just remove all use of Quantity assert helper function calls to Astropy now from Gammapy. But maybe it's possible to improve this to avoid this breaking change that might affect others? |
@@ -460,53 +459,10 @@ 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 | |||
np.testing.assert_allclose(*_unquantify_allclose_arguments(actual, desired, |
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.
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.
Thanks @cdeil for catching this, I wish more packages were testing against the dev version to pick up issues like this so early. |
Wait a minute... My changes here didn't trip any existing tests. And now that I look at the tests, one of them is: with pytest.raises(AssertionError):
assert_quantity_allclose([1, 2] * u.m, [90, 200] * u.cm) I am confused now, as |
Ah nevermind, it is the extra information... Ignore me. (Need more coffee) |
@pllim - ☕️ ☕️ ☕️ ☕️ ☕️ ☕️ ☕️ ☕️ |
Moving function quantity_allclose #7235
Moving function quantity_allclose #7235
Deprecated the quantity_allclose in astropy.tests.helper
Moved function quantity_allclose to astropy.units.quantity
Closes #7235