Skip to content

Commit

Permalink
Fix Unit.create for setting base (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
Routhleck authored Aug 10, 2024
1 parent 1abcb73 commit 3a870f2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion brainunit/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,13 @@ def has_same_dim(self, other: 'Unit') -> bool:
return get_dim(self) == other_dim

@staticmethod
def create(dim: Dimension, name: str, dispname: str, scale: int = 0) -> 'Unit':
def create(
dim: Dimension,
name: str,
dispname: str,
scale: int = 0,
base: float = 10.
) -> 'Unit':
"""
Create a new named unit.
Expand All @@ -1419,6 +1425,7 @@ def create(dim: Dimension, name: str, dispname: str, scale: int = 0) -> 'Unit':
u = Unit(
dim=dim,
scale=scale,
base=base,
name=name,
dispname=dispname,
)
Expand Down

0 comments on commit 3a870f2

Please sign in to comment.