Include the conversion factor in a Unit #78
Conversation
Unit represent the conversion factorUnit
There was a problem hiding this comment.
Should also add x=x.factorless() for ldexp?
There was a problem hiding this comment.
Should also add x=x.factorless() for divmod, power, float_power, multi_dot, matrix_power, and det.
There was a problem hiding this comment.
Should also add x=x.factorless() for remove_diag, intersect1d, nan_to_num, interp, histogram, take, where, unique and modf.
There was a problem hiding this comment.
Should also add x=x.factorless() for digitize, allclose, searchsorted,
| additional_units += _u + ', ' | ||
| additional_units += ']' | ||
|
|
||
|
|
There was a problem hiding this comment.
May need to be compatible with units with factors
| @@ -2730,15 +2928,19 @@ def __len__(self) -> int: | |||
| return len(self.mantissa) | |||
|
|
|||
There was a problem hiding this comment.
Why __neg__, __pos__, __abs__ need self.factorless()
| out : ndarray | ||
| View of `a`, with axes suitably permuted. | ||
| """ | ||
| self = self.factorless() |
There was a problem hiding this comment.
It seems that some methods like transpose do not require factorless()
This pull request includes several updates to the
brainunit/_unit_common.pyfile, primarily focusing on the addition of new units and the standardization of formatting for unit creation. The most important changes include adding new derived units, introducing new units for modular dynamics, and standardizing the formatting of existing unit definitions.This PR enables us to define the unit like
Close #63
Additions:
eV,Angstrom,AMU, andIMF. [1] [2]ysteradian2,ysteradian3,zsteradian2,zsteradian3, etc.Formatting Standardization:
**operator and adjusting the scale formatting. [1] [2] [3] [4] [5]Minor Changes:
__all__list.