Skip to content

Commit 08579c9

Browse files
committed
test: add failing test
1 parent 7d6a3d2 commit 08579c9

File tree

2 files changed

+325
-0
lines changed

2 files changed

+325
-0
lines changed

tests/test_data.py

Lines changed: 317 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,317 @@
1+
from load_distribution import Singularity
2+
import numpy as np
3+
4+
big_list_o_singularities = [
5+
Singularity(
6+
x0=6.628,
7+
x1=7.859,
8+
m=np.float64(0.0),
9+
y0=np.float64(-111.0726290117895),
10+
precision=6,
11+
eps=1e-12,
12+
),
13+
Singularity(
14+
x0=0.001,
15+
x1=0.413,
16+
m=np.float64(0.0),
17+
y0=np.float64(1684.3833962328304),
18+
precision=6,
19+
eps=1e-12,
20+
),
21+
Singularity(
22+
x0=3.172,
23+
x1=6.876,
24+
m=np.float64(0.0),
25+
y0=np.float64(-110.42669320082763),
26+
precision=6,
27+
eps=1e-12,
28+
),
29+
Singularity(
30+
x0=3.172,
31+
x1=6.876,
32+
m=np.float64(0.0),
33+
y0=np.float64(-110.42669320082763),
34+
precision=6,
35+
eps=1e-12,
36+
),
37+
Singularity(
38+
x0=0.001,
39+
x1=3.504,
40+
m=np.float64(0.0),
41+
y0=np.float64(-110.44792139070424),
42+
precision=6,
43+
eps=1e-12,
44+
),
45+
Singularity(
46+
x0=0.001,
47+
x1=3.504,
48+
m=np.float64(0.0),
49+
y0=np.float64(-110.44792139070424),
50+
precision=6,
51+
eps=1e-12,
52+
),
53+
Singularity(
54+
x0=3.172,
55+
x1=6.876,
56+
m=np.float64(0.0),
57+
y0=np.float64(-110.42669320082763),
58+
precision=6,
59+
eps=1e-12,
60+
),
61+
Singularity(
62+
x0=3.172,
63+
x1=6.876,
64+
m=np.float64(0.0),
65+
y0=np.float64(-110.42669320082763),
66+
precision=6,
67+
eps=1e-12,
68+
),
69+
Singularity(
70+
x0=0.001,
71+
x1=3.504,
72+
m=np.float64(0.0),
73+
y0=np.float64(-110.44792139070424),
74+
precision=6,
75+
eps=1e-12,
76+
),
77+
Singularity(
78+
x0=0.001,
79+
x1=3.504,
80+
m=np.float64(0.0),
81+
y0=np.float64(-110.44792139070424),
82+
precision=6,
83+
eps=1e-12,
84+
),
85+
Singularity(
86+
x0=0.001,
87+
x1=3.504,
88+
m=np.float64(0.0),
89+
y0=np.float64(-110.44792139070424),
90+
precision=6,
91+
eps=1e-12,
92+
),
93+
Singularity(
94+
x0=6.628,
95+
x1=7.859,
96+
m=np.float64(0.0),
97+
y0=np.float64(-111.0726290117895),
98+
precision=6,
99+
eps=1e-12,
100+
),
101+
Singularity(
102+
x0=7.57,
103+
x1=7.859,
104+
m=np.float64(0.0),
105+
y0=np.float64(1274.5157420687394),
106+
precision=6,
107+
eps=1e-12,
108+
),
109+
Singularity(
110+
x0=6.628,
111+
x1=7.859,
112+
m=np.float64(0.0),
113+
y0=np.float64(-111.0726290117895),
114+
precision=6,
115+
eps=1e-12,
116+
),
117+
Singularity(
118+
x0=0.001,
119+
x1=0.413,
120+
m=np.float64(0.0),
121+
y0=np.float64(1684.3833962328304),
122+
precision=6,
123+
eps=1e-12,
124+
),
125+
Singularity(
126+
x0=3.172,
127+
x1=6.876,
128+
m=np.float64(0.0),
129+
y0=np.float64(-110.42669320082763),
130+
precision=6,
131+
eps=1e-12,
132+
),
133+
Singularity(
134+
x0=3.172,
135+
x1=6.876,
136+
m=np.float64(0.0),
137+
y0=np.float64(-110.42669320082763),
138+
precision=6,
139+
eps=1e-12,
140+
),
141+
Singularity(
142+
x0=0.001,
143+
x1=3.504,
144+
m=np.float64(0.0),
145+
y0=np.float64(-110.44792139070424),
146+
precision=6,
147+
eps=1e-12,
148+
),
149+
Singularity(
150+
x0=0.001,
151+
x1=3.504,
152+
m=np.float64(0.0),
153+
y0=np.float64(-110.44792139070424),
154+
precision=6,
155+
eps=1e-12,
156+
),
157+
Singularity(
158+
x0=3.172,
159+
x1=6.876,
160+
m=np.float64(0.0),
161+
y0=np.float64(-110.42669320082763),
162+
precision=6,
163+
eps=1e-12,
164+
),
165+
Singularity(
166+
x0=3.172,
167+
x1=6.876,
168+
m=np.float64(0.0),
169+
y0=np.float64(-110.42669320082763),
170+
precision=6,
171+
eps=1e-12,
172+
),
173+
Singularity(
174+
x0=0.001,
175+
x1=3.504,
176+
m=np.float64(0.0),
177+
y0=np.float64(-110.44792139070424),
178+
precision=6,
179+
eps=1e-12,
180+
),
181+
Singularity(
182+
x0=0.001,
183+
x1=3.504,
184+
m=np.float64(0.0),
185+
y0=np.float64(-110.44792139070424),
186+
precision=6,
187+
eps=1e-12,
188+
),
189+
Singularity(
190+
x0=0.001,
191+
x1=3.504,
192+
m=np.float64(0.0),
193+
y0=np.float64(-110.44792139070424),
194+
precision=6,
195+
eps=1e-12,
196+
),
197+
Singularity(
198+
x0=6.628,
199+
x1=7.859,
200+
m=np.float64(0.0),
201+
y0=np.float64(-111.0726290117895),
202+
precision=6,
203+
eps=1e-12,
204+
),
205+
Singularity(
206+
x0=7.57,
207+
x1=7.859,
208+
m=np.float64(0.0),
209+
y0=np.float64(1274.5157420687394),
210+
precision=6,
211+
eps=1e-12,
212+
),
213+
Singularity(
214+
x0=6.628,
215+
x1=7.859,
216+
m=np.float64(0.0),
217+
y0=np.float64(-111.0726290117895),
218+
precision=6,
219+
eps=1e-12,
220+
),
221+
Singularity(
222+
x0=0.001,
223+
x1=0.413,
224+
m=np.float64(0.0),
225+
y0=np.float64(1684.3833962328304),
226+
precision=6,
227+
eps=1e-12,
228+
),
229+
Singularity(
230+
x0=3.172,
231+
x1=6.876,
232+
m=np.float64(0.0),
233+
y0=np.float64(-110.42669320082763),
234+
precision=6,
235+
eps=1e-12,
236+
),
237+
Singularity(
238+
x0=3.172,
239+
x1=6.876,
240+
m=np.float64(0.0),
241+
y0=np.float64(-110.42669320082763),
242+
precision=6,
243+
eps=1e-12,
244+
),
245+
Singularity(
246+
x0=0.001,
247+
x1=3.504,
248+
m=np.float64(0.0),
249+
y0=np.float64(-110.44792139070424),
250+
precision=6,
251+
eps=1e-12,
252+
),
253+
Singularity(
254+
x0=0.001,
255+
x1=3.504,
256+
m=np.float64(0.0),
257+
y0=np.float64(-110.44792139070424),
258+
precision=6,
259+
eps=1e-12,
260+
),
261+
Singularity(
262+
x0=3.172,
263+
x1=6.876,
264+
m=np.float64(0.0),
265+
y0=np.float64(-110.42669320082763),
266+
precision=6,
267+
eps=1e-12,
268+
),
269+
Singularity(
270+
x0=3.172,
271+
x1=6.876,
272+
m=np.float64(0.0),
273+
y0=np.float64(-110.42669320082763),
274+
precision=6,
275+
eps=1e-12,
276+
),
277+
Singularity(
278+
x0=0.001,
279+
x1=3.504,
280+
m=np.float64(0.0),
281+
y0=np.float64(-110.44792139070424),
282+
precision=6,
283+
eps=1e-12,
284+
),
285+
Singularity(
286+
x0=0.001,
287+
x1=3.504,
288+
m=np.float64(0.0),
289+
y0=np.float64(-110.44792139070424),
290+
precision=6,
291+
eps=1e-12,
292+
),
293+
Singularity(
294+
x0=0.001,
295+
x1=3.504,
296+
m=np.float64(0.0),
297+
y0=np.float64(-110.44792139070424),
298+
precision=6,
299+
eps=1e-12,
300+
),
301+
Singularity(
302+
x0=6.628,
303+
x1=7.859,
304+
m=np.float64(0.0),
305+
y0=np.float64(-111.0726290117895),
306+
precision=6,
307+
eps=1e-12,
308+
),
309+
Singularity(
310+
x0=7.57,
311+
x1=7.859,
312+
m=np.float64(0.0),
313+
y0=np.float64(1274.5157420687394),
314+
precision=6,
315+
eps=1e-12,
316+
),
317+
]

tests/test_load_distribution.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import load_distribution as ld
2+
import test_data as data
23
from shapely import Polygon, GeometryCollection
34

45
import pytest
@@ -236,6 +237,13 @@ def test_singularities_to_polygon():
236237
== "POLYGON ((0 0, 0.034368 0, 0.051573 0.5, 0.051573 0.5, 11.705 0.5, 11.705 0, 0 0))"
237238
)
238239

240+
# This test fails due to popping multiple items from a list where the indexes have changed
241+
# because of the popping
242+
243+
assert (
244+
ld.singularities_to_polygon(data.big_list_o_singularities).wkt
245+
) == "FAILING TEST"
246+
239247

240248
def test_overlap_region_to_singularity():
241249
assert ld.overlap_region_to_singularity(

0 commit comments

Comments
 (0)