From 617d0a60058d2d47cf71ee37a3e564a38e26225d Mon Sep 17 00:00:00 2001 From: Chaoming Wang Date: Fri, 9 Aug 2024 10:10:28 +0800 Subject: [PATCH] upgrade --- brainunit/_base.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/brainunit/_base.py b/brainunit/_base.py index c113067..d2f5101 100644 --- a/brainunit/_base.py +++ b/brainunit/_base.py @@ -1767,7 +1767,17 @@ def __init__( self._unit = unit @property - def mantissa(self): + def mantissa(self) -> jax.typing.ArrayLike: + r""" + The mantissa of the array. + + In the scientific notation, :math:`x = a * 10^b`, the mantissa :math:`a` is the part of + a floating-point number that contains its significant digits. For example, in the number + :math:`3.14 * 10^5`, the mantissa is :math:`3.14`. + + Returns: + The mantissa of the array. + """ return self._mantissa def update_value(self, mantissa: PyTree): @@ -1918,8 +1928,9 @@ def has_same_unit(self, other): bool Whether the two Arrays have the same unit dimensions """ - other_unit = get_dim(other.dim) - return (get_dim(self.dim) is other_unit) or (get_dim(self.dim) == other_unit) + self_dim = get_dim(self.dim) + other_dim = get_dim(other.dim) + return (self_dim is other_dim) or (self_dim == other_dim) def repr_in_unit( self,