-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include the conversion factor in a Unit
#78
Conversation
Unit
represent the conversion factorUnit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also add x=x.factorless()
for ldexp
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also add x=x.factorless()
for divmod
, power
, float_power
, multi_dot
, matrix_power
, and det
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also add x=x.factorless()
for digitize
, allclose
, searchsorted
,
@@ -121,6 +122,14 @@ | |||
additional_units += _u + ', ' | |||
additional_units += ']' | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why __neg__
, __pos__
, __abs__
need self.factorless()
@@ -3369,6 +3613,7 @@ def transpose(self, *axes) -> 'Quantity': | |||
out : ndarray | |||
View of `a`, with axes suitably permuted. | |||
""" | |||
self = self.factorless() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that some methods like transpose
do not require factorless()
This pull request includes several updates to the
brainunit/_unit_common.py
file, 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.