Define a valid interval, so that : ``domain_check_interval(a,b)(x) == True`` where ``x < a`` or ``x > b``.
| 846 | |
| 847 | |
| 848 | class _DomainCheckInterval: |
| 849 | """ |
| 850 | Define a valid interval, so that : |
| 851 | |
| 852 | ``domain_check_interval(a,b)(x) == True`` where |
| 853 | ``x < a`` or ``x > b``. |
| 854 | |
| 855 | """ |
| 856 | |
| 857 | def __init__(self, a, b): |
| 858 | "domain_check_interval(a,b)(x) = true where x < a or y > b" |
| 859 | if a > b: |
| 860 | (a, b) = (b, a) |
| 861 | self.a = a |
| 862 | self.b = b |
| 863 | |
| 864 | def __call__(self, x): |
| 865 | "Execute the call behavior." |
| 866 | # nans at masked positions cause RuntimeWarnings, even though |
| 867 | # they are masked. To avoid this we suppress warnings. |
| 868 | with np.errstate(invalid='ignore'): |
| 869 | return umath.logical_or(umath.greater(x, self.b), |
| 870 | umath.less(x, self.a)) |
| 871 | |
| 872 | |
| 873 | class _DomainTan: |
no outgoing calls
no test coverage detected
searching dependent graphs…