diff options
Diffstat (limited to 'pint/facets')
-rw-r--r-- | pint/facets/plain/quantity.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pint/facets/plain/quantity.py b/pint/facets/plain/quantity.py index 5e4f33d..a36faa3 100644 --- a/pint/facets/plain/quantity.py +++ b/pint/facets/plain/quantity.py @@ -144,6 +144,12 @@ class PlainQuantity(PrettyIPython, SharedRegistryObject, Generic[_MagnitudeType] _magnitude: _MagnitudeType @property + def ndim(self) -> int: + if isinstance(self.magnitude, numbers.Number): + return 0 + return self.magnitude.ndim + + @property def force_ndarray(self) -> bool: return self._REGISTRY.force_ndarray |