def test_high_in_high(self): x = array([2.0, 0.5, 2]) result = intersect_range(x, 0.0, 1.0) assert_array_equal(result, [True]*3)
def test_in_low_in(self): x = array([0.5, -2.0, 0.5]) result = intersect_range(x, 0.0, 1.0) assert_array_equal(result, [True, True, True])
def test_low_high_in(self): x = array([-3.0, 2, 0.5]) result = intersect_range(x, 0.0, 1.0) assert_array_equal(result, [True]*3)
def test_low_lower_bound(self): x = array([-1.0, 0.0]) result = intersect_range(x, 0.0, 1.0) assert_array_equal(result, [True]*2)
def test_low_low_low(self): x = array([-3.0, -2.0, -1.0]) result = intersect_range(x, 0.0, 1.0) assert_array_equal(result, [False]*3)
def test_nan_low_low(self): x = array([nan, 2, 3]) result = intersect_range(x, 0.0, 1.0) assert_array_equal(result, [False, False, False])
def test_all_inside(self): x = linspace(1, 2, 101) result = intersect_range(x, 0.0, 3.0) assert_array_equal(result, ones(101, dtype=bool))
def test_high_low_high(self): x = array([2.0, -2.0, 2]) result = intersect_range(x, 0.0, 1.0) assert_array_equal(result, [True, True, True])
def test_in_in_in(self): x = array([0.75, 0.5, 0.25]) result = intersect_range(x, 0.0, 1.0) assert_array_equal(result, [True]*3)
def test_in_high_low(self): x = array([0.5, 2, -1.0]) result = intersect_range(x, 0.0, 1.0) assert_array_equal(result, [True]*3)
def test_high_high(self): x = array([3.0, 2.0]) result = intersect_range(x, 0.0, 1.0) assert_array_equal(result, [False]*2)
def test_high_high_high(self): x = array([2.5, 2, 3]) result = intersect_range(x, 0.0, 1.0) assert_array_equal(result, [False, False, False])
def test_in_mask_in(self): x = array([0.5, 0.25, 0.75]) mask = array([True, False, True]) result = intersect_range(x, 0.0, 1.0, mask) assert_array_equal(result, [True, False, True])
def test_low_high_high(self): x = array([-3.0, 2, 3]) result = intersect_range(x, 0.0, 1.0) assert_array_equal(result, [True, True, False])
def test_in_nan_in(self): x = array([0.5, nan, 0.75]) result = intersect_range(x, 0.0, 1.0) assert_array_equal(result, [True, False, True])
def test_mask_high_low(self): x = array([1, 2, -1.0]) mask = array([False, True, True]) result = intersect_range(x, 0.0, 1.0, mask) assert_array_equal(result, [False, True, True])
def test_low_low_mask(self): x = array([-0.5, -1.0, 0.5]) mask = array([True, True, False]) result = intersect_range(x, 0.0, 1.0, mask) assert_array_equal(result, [False, False, False])
def test_nan_high_low(self): x = array([nan, 2, -1.0]) result = intersect_range(x, 0.0, 1.0) assert_array_equal(result, [False, True, True])
def test_low_low_nan(self): x = array([-0.5, -1.0, nan]) result = intersect_range(x, 0.0, 1.0) assert_array_equal(result, [False, False, False])
def test_all_inside_mask(self): x = linspace(1, 2, 101) mask = (x <= 1.4) | (x >= 1.6) result = intersect_range(x, 0.0, 3.0, mask) print(mask ^ result) assert_array_equal(result, mask)
def test_empty(self): x = array([]) result = intersect_range(x, 0.0, 1.0) assert_array_equal(result, [])
def test_all_inside_mask(self): x = linspace(1, 2, 101) mask = (x <= 1.4) | (x >= 1.6) result = intersect_range(x, 0.0, 3.0, mask) assert_array_equal(result, mask)