4
4
import pytest
5
5
from adaptive .tests .domain_utils import (
6
6
a_few_points_inside ,
7
- make_hypercube_domain ,
7
+ make_random_domain ,
8
8
point_inside ,
9
9
point_on_shared_face ,
10
10
point_outside ,
18
18
@given (data = st .data ())
19
19
@settings (deadline = 500 )
20
20
def test_getting_points_are_unique (data , ndim ):
21
- domain = data .draw (make_hypercube_domain (ndim ))
21
+ domain = data .draw (make_random_domain (ndim ))
22
22
points = []
23
23
for subdomain in domain .subdomains ():
24
24
p , _ = domain .insert_points (subdomain , 10 )
@@ -30,7 +30,7 @@ def test_getting_points_are_unique(data, ndim):
30
30
@pytest .mark .parametrize ("ndim" , [1 , 2 , 3 ])
31
31
@given (data = st .data ())
32
32
def test_sum_subvolumes_equals_volume (data , ndim ):
33
- domain = data .draw (make_hypercube_domain (ndim ))
33
+ domain = data .draw (make_random_domain (ndim ))
34
34
xs = data .draw (a_few_points_inside (domain ))
35
35
36
36
for x in xs :
@@ -42,7 +42,7 @@ def test_sum_subvolumes_equals_volume(data, ndim):
42
42
@pytest .mark .parametrize ("ndim" , [1 , 2 , 3 ])
43
43
@given (data = st .data ())
44
44
def test_split_at_vertex_raises (data , ndim ):
45
- domain = data .draw (make_hypercube_domain (ndim ))
45
+ domain = data .draw (make_random_domain (ndim ))
46
46
x = data .draw (point_inside (domain ))
47
47
domain .split_at (x )
48
48
with pytest .raises (ValueError ):
@@ -52,7 +52,7 @@ def test_split_at_vertex_raises(data, ndim):
52
52
@pytest .mark .parametrize ("ndim" , [1 , 2 , 3 ])
53
53
@given (data = st .data ())
54
54
def test_inserting_point_twice_raises (data , ndim ):
55
- domain = data .draw (make_hypercube_domain (ndim ))
55
+ domain = data .draw (make_random_domain (ndim ))
56
56
x = data .draw (point_inside (domain ))
57
57
domain .insert (x )
58
58
with pytest .raises (ValueError ):
@@ -62,7 +62,7 @@ def test_inserting_point_twice_raises(data, ndim):
62
62
@pytest .mark .parametrize ("ndim" , [1 , 2 , 3 ])
63
63
@given (data = st .data ())
64
64
def test_insert_points_outside_domain_raises (data , ndim ):
65
- domain = data .draw (make_hypercube_domain (ndim ))
65
+ domain = data .draw (make_random_domain (ndim ))
66
66
x = data .draw (point_outside (domain ))
67
67
with pytest .raises (ValueError ):
68
68
domain .insert (x )
@@ -71,7 +71,7 @@ def test_insert_points_outside_domain_raises(data, ndim):
71
71
@pytest .mark .parametrize ("ndim" , [1 , 2 , 3 ])
72
72
@given (data = st .data ())
73
73
def test_encloses (data , ndim ):
74
- domain = data .draw (make_hypercube_domain (ndim ))
74
+ domain = data .draw (make_random_domain (ndim ))
75
75
76
76
xin = data .draw (point_inside (domain ))
77
77
assert domain .encloses (xin )
@@ -89,7 +89,7 @@ def test_encloses(data, ndim):
89
89
@pytest .mark .parametrize ("ndim" , [1 , 2 , 3 ])
90
90
@given (data = st .data ())
91
91
def test_insert_point_outside_domain_raises (data , ndim ):
92
- domain = data .draw (make_hypercube_domain (ndim ))
92
+ domain = data .draw (make_random_domain (ndim ))
93
93
x = data .draw (point_outside (domain ))
94
94
with pytest .raises (ValueError ):
95
95
domain .insert (x )
@@ -98,7 +98,7 @@ def test_insert_point_outside_domain_raises(data, ndim):
98
98
@pytest .mark .parametrize ("ndim" , [1 , 2 , 3 ])
99
99
@given (data = st .data ())
100
100
def test_split_at_point_outside_domain_raises (data , ndim ):
101
- domain = data .draw (make_hypercube_domain (ndim ))
101
+ domain = data .draw (make_random_domain (ndim ))
102
102
x = data .draw (point_outside (domain ))
103
103
with pytest .raises (ValueError ):
104
104
domain .split_at (x )
@@ -107,7 +107,7 @@ def test_split_at_point_outside_domain_raises(data, ndim):
107
107
@pytest .mark .parametrize ("ndim" , [1 , 2 , 3 ])
108
108
@given (data = st .data ())
109
109
def test_removing_domain_vertex_raises (data , ndim ):
110
- domain = data .draw (make_hypercube_domain (ndim ))
110
+ domain = data .draw (make_random_domain (ndim ))
111
111
x = data .draw (point_inside (domain ))
112
112
domain .split_at (x )
113
113
with pytest .raises (ValueError ):
@@ -117,7 +117,7 @@ def test_removing_domain_vertex_raises(data, ndim):
117
117
@pytest .mark .parametrize ("ndim" , [1 , 2 , 3 ])
118
118
@given (data = st .data ())
119
119
def test_removing_nonexistant_point_raises (data , ndim ):
120
- domain = data .draw (make_hypercube_domain (ndim ))
120
+ domain = data .draw (make_random_domain (ndim ))
121
121
x = data .draw (point_inside (domain ))
122
122
with pytest .raises (ValueError ):
123
123
domain .remove (x )
@@ -126,7 +126,7 @@ def test_removing_nonexistant_point_raises(data, ndim):
126
126
@pytest .mark .parametrize ("ndim" , [1 , 2 , 3 ])
127
127
@given (data = st .data ())
128
128
def test_splitting_at_point_adds_to_vertices (data , ndim ):
129
- domain = data .draw (make_hypercube_domain (ndim ))
129
+ domain = data .draw (make_random_domain (ndim ))
130
130
xs = data .draw (a_few_points_inside (domain ))
131
131
132
132
for x in xs :
@@ -138,7 +138,7 @@ def test_splitting_at_point_adds_to_vertices(data, ndim):
138
138
@pytest .mark .parametrize ("ndim" , [1 , 2 , 3 ])
139
139
@given (data = st .data ())
140
140
def test_inserting_points_adds_to_subpoints (data , ndim ):
141
- domain = data .draw (make_hypercube_domain (ndim ))
141
+ domain = data .draw (make_random_domain (ndim ))
142
142
xs = data .draw (a_few_points_inside (domain ))
143
143
144
144
subdomains = dict ()
@@ -152,7 +152,7 @@ def test_inserting_points_adds_to_subpoints(data, ndim):
152
152
@pytest .mark .parametrize ("ndim" , [1 , 2 , 3 ])
153
153
@given (data = st .data ())
154
154
def test_inserting_then_removing_points_removes_from_subpoints (data , ndim ):
155
- domain = data .draw (make_hypercube_domain (ndim ))
155
+ domain = data .draw (make_random_domain (ndim ))
156
156
xs = data .draw (a_few_points_inside (domain ))
157
157
158
158
for x in xs :
@@ -166,7 +166,7 @@ def test_inserting_then_removing_points_removes_from_subpoints(data, ndim):
166
166
@given (data = st .data ())
167
167
@settings (deadline = 500 )
168
168
def test_inserting_then_splitting_at_points_removes_from_subpoints (data , ndim ):
169
- domain = data .draw (make_hypercube_domain (ndim ))
169
+ domain = data .draw (make_random_domain (ndim ))
170
170
xs = data .draw (a_few_points_inside (domain ))
171
171
172
172
for x in xs :
@@ -179,7 +179,7 @@ def test_inserting_then_splitting_at_points_removes_from_subpoints(data, ndim):
179
179
@pytest .mark .parametrize ("ndim" , [1 , 2 , 3 ])
180
180
@given (data = st .data ())
181
181
def test_clear_subdomains_removes_all_points (data , ndim ):
182
- domain = data .draw (make_hypercube_domain (ndim ))
182
+ domain = data .draw (make_random_domain (ndim ))
183
183
xs = data .draw (a_few_points_inside (domain ))
184
184
185
185
for x in xs :
@@ -192,7 +192,7 @@ def test_clear_subdomains_removes_all_points(data, ndim):
192
192
@pytest .mark .parametrize ("ndim" , [1 , 2 , 3 ])
193
193
@given (data = st .data ())
194
194
def test_split_at_reassigns_all_internal_points (data , ndim ):
195
- domain = data .draw (make_hypercube_domain (ndim ))
195
+ domain = data .draw (make_random_domain (ndim ))
196
196
x_split , * xs = data .draw (a_few_points_inside (domain ))
197
197
198
198
for x in xs :
@@ -216,7 +216,7 @@ def test_split_at_reassigns_all_internal_points(data, ndim):
216
216
@pytest .mark .parametrize ("ndim" , [2 , 3 ])
217
217
@given (data = st .data ())
218
218
def test_inserting_point_on_boundary_adds_to_all_subtriangulations (data , ndim ):
219
- domain = data .draw (make_hypercube_domain (ndim ))
219
+ domain = data .draw (make_random_domain (ndim ))
220
220
xs = data .draw (a_few_points_inside (domain ))
221
221
222
222
for x in xs :
0 commit comments