From d56c232f4c045155f5472903c33a6767e353b43f Mon Sep 17 00:00:00 2001 From: Nathaniel Starkman Date: Tue, 31 Dec 2024 13:43:17 -0800 Subject: [PATCH] =?UTF-8?q?=E2=9A=B0=EF=B8=8F=20dead(vecs):=20remove=20unn?= =?UTF-8?q?eeded=20checks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/coordinax/_src/vectors/checks.py | 62 ---------------------------- 1 file changed, 62 deletions(-) diff --git a/src/coordinax/_src/vectors/checks.py b/src/coordinax/_src/vectors/checks.py index ab7b4492..9df99927 100644 --- a/src/coordinax/_src/vectors/checks.py +++ b/src/coordinax/_src/vectors/checks.py @@ -137,37 +137,6 @@ def check_non_negative_non_zero( ) -def check_less_than( - x: AbstractQuantity, - max_val: AbstractQuantity, - /, - *, - name: str = "", - comparison_name: str = "the specified maximum value", -) -> AbstractQuantity: - """Check that the input value is less than the input maximum value. - - Examples - -------- - >>> import unxt as u - - Pass through the input if the value is less than the max value: - - >>> x = u.Quantity([1, 2, 3], "m") - >>> check_less_than(x, u.Quantity(4, "m")) - Quantity['length'](Array([1, 2, 3], dtype=int32), unit='m') - - Raise an error if the input is larger than the maximum value. - - >>> try: check_less_than(x, u.Quantity(1.5, "m")) - ... except Exception: pass - - """ - name = f" {name}" if name else name - msg = f"The input{name} must be less than {comparison_name}." - return eqx.error_if(x, jnp.any(x >= max_val), msg) - - def check_less_than_equal( x: AbstractQuantity, max_val: AbstractQuantity, @@ -199,37 +168,6 @@ def check_less_than_equal( return eqx.error_if(x, jnp.any(x > max_val), msg) -def check_greater_than( - x: AbstractQuantity, - min_val: AbstractQuantity, - /, - *, - name: str = "", - comparison_name: str = "the specified minimum value", -) -> AbstractQuantity: - """Check that the input value is greater than the input minimum value. - - Examples - -------- - >>> import unxt as u - - Pass through the input if the value is greater than the min value: - - >>> x = u.Quantity([1, 2, 3], "m") - >>> check_greater_than(x, u.Quantity(0, "m")) - Quantity['length'](Array([1, 2, 3], dtype=int32), unit='m') - - Raise an error if the input is smaller than the minimum value. - - >>> try: check_greater_than(x, u.Quantity(4, "m")) - ... except Exception: pass - - """ - name = f" {name}" if name else name - msg = f"The input{name} must be greater than {comparison_name}." - return eqx.error_if(x, jnp.any(x <= min_val), msg) - - def check_greater_than_equal( x: AbstractQuantity, min_val: AbstractQuantity,