Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoming0625 committed Aug 23, 2024
1 parent 25ec0d5 commit 8fa0128
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions brainunit/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1156,12 +1156,12 @@ def _create_name(dim: Dimension, base, scale) -> str:


def _find_name(dim: Dimension, base, scale) -> Tuple[str, str]:
if dim == DIMENSIONLESS:
name = f"Unit({base ** scale})"
return name, name

if isinstance(base, (int, float)):
if isinstance(scale, (int, float)):
if dim == DIMENSIONLESS:
name = f"Unit({base ** scale})"
return name, name

key = (dim, scale, base)
if key in _standard_units:
name = _standard_units[key].name
Expand All @@ -1171,6 +1171,7 @@ def _find_name(dim: Dimension, base, scale) -> Tuple[str, str]:
if key in _standard_units:
name = _standard_units[key].name
return name, name

name = _create_name(dim, base, scale)
return name, name

Expand Down

0 comments on commit 8fa0128

Please sign in to comment.