Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoming0625 committed Nov 6, 2024
1 parent 2404a6f commit 2ccd16d
Show file tree
Hide file tree
Showing 2 changed files with 869 additions and 210 deletions.
2 changes: 1 addition & 1 deletion brainunit/math/_fun_array_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ def asarray(
leaf_unit = leaves[0].unit

# get unit
if unit is not None:
if unit is not None and not leaf_unit.is_unitless:
assert isinstance(unit, Unit), f'unit must be an instance of Unit, got {type(unit)}'
leaves = [leaf.in_unit(unit) for leaf in leaves]
else:
Expand Down
Loading

0 comments on commit 2ccd16d

Please sign in to comment.