diff options
author | Andrew <andrewgsavage@gmail.com> | 2022-10-15 14:05:32 +0100 |
---|---|---|
committer | Andrew <andrewgsavage@gmail.com> | 2022-10-15 14:05:32 +0100 |
commit | c258eed2fb8eb0c53dc0b016f9391749af3d0390 (patch) | |
tree | 204aa35040d7a99664377031541b2391e9862a6a /pint/facets | |
parent | f78b2b7e42766da6bee78b059ca7e6a15c98076b (diff) | |
download | pint-c258eed2fb8eb0c53dc0b016f9391749af3d0390.tar.gz |
subok
Diffstat (limited to 'pint/facets')
-rw-r--r-- | pint/facets/numpy/numpy_func.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pint/facets/numpy/numpy_func.py b/pint/facets/numpy/numpy_func.py index 44bdfe9..2c07281 100644 --- a/pint/facets/numpy/numpy_func.py +++ b/pint/facets/numpy/numpy_func.py @@ -77,6 +77,8 @@ def convert_arg(arg, pre_calc_units): Helper function for convert_to_consistent_units. pre_calc_units must be given as a pint Unit or None. """ + if isinstance(arg, bool): + return arg if pre_calc_units is not None: if _is_quantity(arg): return arg.m_as(pre_calc_units) @@ -101,7 +103,7 @@ def convert_to_consistent_units(*args, pre_calc_units=None, **kwargs): If pre_calc_units is not None, takes the args and kwargs for a NumPy function and converts any Quantity or Sequence of Quantities into the units of the first - Quantity/Sequence of Quantities and returns the magnitudes. Other args/kwargs are + Quantity/Sequence of Quantities and returns the magnitudes. Other args/kwargs (except booleans) are treated as dimensionless Quantities. If pre_calc_units is None, units are simply stripped. """ |