Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Routhleck committed Dec 22, 2024
1 parent 1a6ab3e commit 3ff33c7
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions brainunit/math/_fun_keep_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
'percentile', 'nanpercentile', 'quantile', 'nanquantile',

# math funcs only accept unitless (unary) can return Quantity
'round', 'around', 'round_', 'rint', 'floor', 'ceil', 'trunc', 'fix', 'modf',
'round', 'around', 'rint', 'floor', 'ceil', 'trunc', 'fix', 'modf',

# math funcs keep unit (binary)
'fmod', 'mod', 'copysign', 'remainder',
Expand Down Expand Up @@ -3377,24 +3377,6 @@ def unique(
fill_value=fill_value)


@set_module_as('brainunit.math')
def round_(
x: Union[Quantity, jax.typing.ArrayLike],
) -> jax.Array | Quantity:
"""
Round an array to the nearest integer.
Parameters
----------
x : array_like, Quantity
Input array.
Returns
-------
out : jax.Array
"""
return _fun_keep_unit_unary(jnp.round, x)


@set_module_as('brainunit.math')
def round(
Expand Down

0 comments on commit 3ff33c7

Please sign in to comment.