Skip to content

Commit

Permalink
remove deprecated jnp.round_
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoming0625 committed Dec 14, 2024
1 parent 86a9689 commit 18f78fb
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions brainunit/math/_fun_keep_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -3393,13 +3393,12 @@ def round_(
-------
out : jax.Array
"""
return _fun_keep_unit_unary(jnp.round_, x)
return _fun_keep_unit_unary(jnp.round, x)


@set_module_as('brainunit.math')
def around(
def round(
x: Union[Quantity, jax.typing.ArrayLike],
decimals: int = 0,
) -> jax.Array | Quantity:
"""
Round an array to the nearest integer.
Expand All @@ -3408,18 +3407,16 @@ def around(
----------
x : array_like, Quantity
Input array.
decimals : int, optional
Number of decimal places to round to (default is 0).
Returns
-------
out : jax.Array
"""
return _fun_keep_unit_unary(jnp.around, x, decimals=decimals)
return _fun_keep_unit_unary(jnp.round, x)


@set_module_as('brainunit.math')
def round(
def around(
x: Union[Quantity, jax.typing.ArrayLike],
decimals: int = 0,
) -> jax.Array | Quantity:
Expand All @@ -3437,7 +3434,7 @@ def round(
-------
out : jax.Array
"""
return _fun_keep_unit_unary(jnp.round, x, decimals=decimals)
return _fun_keep_unit_unary(jnp.around, x, decimals=decimals)


@set_module_as('brainunit.math')
Expand Down

0 comments on commit 18f78fb

Please sign in to comment.