Skip to content

Commit

Permalink
docs: sign docstring (#112)
Browse files Browse the repository at this point in the history
Signed-off-by: nstarman <nstarman@users.noreply.github.com>
  • Loading branch information
nstarman committed May 16, 2024
1 parent f76ab8c commit ac349c6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/unxt/_quantity/register_primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -3215,6 +3215,23 @@ def _shift_right_logical_p() -> AbstractQuantity:

@register(lax.sign_p)
def _sign_p(x: AbstractQuantity) -> ArrayLike:
"""Sign of a quantity.
Examples
--------
>>> import quaxed.numpy as qnp
>>> from unxt import UncheckedQuantity
>>> q = UncheckedQuantity(10, "m")
>>> qnp.sign(q)
Array(1, dtype=int32, ...)
>>> from unxt import Quantity
>>> q = Quantity(10, "m")
>>> qnp.sign(q)
Array(1, dtype=int32, ...)
"""
return lax.sign(x.value)


Expand Down

0 comments on commit ac349c6

Please sign in to comment.