MCPcopy Create free account
hub / github.com/numpy/numpy / _DomainCheckInterval

Class _DomainCheckInterval

numpy/ma/core.py:797–819  ·  view source on GitHub ↗

Define a valid interval, so that : ``domain_check_interval(a,b)(x) == True`` where ``x < a`` or ``x > b``.

Source from the content-addressed store, hash-verified

795
796
797class _DomainCheckInterval:
798 """
799 Define a valid interval, so that :
800
801 ``domain_check_interval(a,b)(x) == True`` where
802 ``x < a`` or ``x > b``.
803
804 """
805
806 def __init__(self, a, b):
807 "domain_check_interval(a,b)(x) = true where x < a or y > b"
808 if a > b:
809 (a, b) = (b, a)
810 self.a = a
811 self.b = b
812
813 def __call__(self, x):
814 "Execute the call behavior."
815 # nans at masked positions cause RuntimeWarnings, even though
816 # they are masked. To avoid this we suppress warnings.
817 with np.errstate(invalid='ignore'):
818 return umath.logical_or(umath.greater(x, self.b),
819 umath.less(x, self.a))
820
821
822class _DomainTan:

Callers 1

core.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected