Esempio n. 1
0
 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)
Esempio n. 2
0
 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])
Esempio n. 3
0
 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)
Esempio n. 4
0
 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)
Esempio n. 5
0
 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)
Esempio n. 6
0
 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])
Esempio n. 7
0
 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))
Esempio n. 8
0
 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)
Esempio n. 9
0
 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])
Esempio n. 10
0
 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])
Esempio n. 11
0
 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)
Esempio n. 12
0
 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)
Esempio n. 13
0
 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)
Esempio n. 14
0
 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)
Esempio n. 15
0
 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])
Esempio n. 16
0
 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)
Esempio n. 17
0
 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])
Esempio n. 18
0
 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])
Esempio n. 19
0
 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])
Esempio n. 20
0
 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])
Esempio n. 21
0
 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)
Esempio n. 22
0
 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])
Esempio n. 23
0
 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)
Esempio n. 24
0
 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])
Esempio n. 25
0
 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)
Esempio n. 26
0
 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])
Esempio n. 27
0
 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)
Esempio n. 28
0
 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])
Esempio n. 29
0
 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])
Esempio n. 30
0
 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])
Esempio n. 31
0
 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])
Esempio n. 32
0
 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])
Esempio n. 33
0
 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])
Esempio n. 34
0
 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])
Esempio n. 35
0
 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])
Esempio n. 36
0
 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))
Esempio n. 37
0
 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])
Esempio n. 38
0
 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)
Esempio n. 39
0
 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])
Esempio n. 40
0
 def test_empty(self):
     x = array([])
     result = intersect_range(x, 0.0, 1.0)
     assert_array_equal(result, [])
Esempio n. 41
0
 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)
Esempio n. 42
0
 def test_empty(self):
     x = array([])
     result = intersect_range(x, 0.0, 1.0)
     assert_array_equal(result, [])