From 18f78fb40fb2a172348f452a1ce6d7d2900351d2 Mon Sep 17 00:00:00 2001 From: Chaoming Wang Date: Sat, 14 Dec 2024 14:37:47 +0800 Subject: [PATCH] remove deprecated `jnp.round_` --- brainunit/math/_fun_keep_unit.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/brainunit/math/_fun_keep_unit.py b/brainunit/math/_fun_keep_unit.py index d4a2f37..4af911d 100644 --- a/brainunit/math/_fun_keep_unit.py +++ b/brainunit/math/_fun_keep_unit.py @@ -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. @@ -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: @@ -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')