Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Nathaniel Starkman (@nstarman) <nstarkman@protonmail.com>
  • Loading branch information
nstarman committed Oct 12, 2021
1 parent a2a4389 commit 65f5458
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions astropy/units/quantity_helper/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ def register_ufunc(ufunc, inunits, ounits, *, assume_correct_units=False):
>>> ufunc(36)
96.8
>>> ufunc(np.array([0, 10, 20])) # note dtype is an object
>>> ufunc(np.array([0, 10, 20])) # note return dtype is an object
array([32.0, 50.0, 68.0], dtype=object)
2. The function cannot return a Quantity with units. If so, an object array
Expand All @@ -448,7 +448,7 @@ def register_ufunc(ufunc, inunits, ounits, *, assume_correct_units=False):
>>> exufunc = np.frompyfunc(exfunc, 2, 1)
>>> register_ufunc(exufunc, [u.km, u.s], ["km2/s"],
... assume_correct_units=True)
>>> exufunc(3 * u.km, 2)
>>> exufunc(3 * u.km, 2) # arg 2 is unitless. 'inunits' are assumed.
<Quantity 4.5 km2 / s>
"""
Expand Down
4 changes: 2 additions & 2 deletions astropy/units/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def quantity_asanyarray(a, dtype=None):
return np.asanyarray(a, dtype=dtype)


# ------------------------------------------------------------------------------
# -----------------------------------------------------------------------------


def frompyfunc(func, nin, nout, inunits=None, ounits=None,
Expand Down Expand Up @@ -423,7 +423,7 @@ def frompyfunc(func, nin, nout, inunits=None, ounits=None,
<Quantity 4.5 km2 / s>
"""
from astropy.units import Unit
from astropy.units.core import Unit
from astropy.units.quantity_helper.helpers import (
_is_ulike, _is_seq_ulike, register_ufunc)

Expand Down

0 comments on commit 65f5458

Please sign in to comment.