File: test_typecheck.py

package info (click to toggle)
contourpy 1.3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 16,688 kB
  • sloc: python: 7,998; cpp: 6,241; makefile: 13
file content (388 lines) | stat: -rw-r--r-- 21,341 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
from __future__ import annotations

import numpy as np
import pytest

from contourpy import FillType, LineType
from contourpy.typecheck import (
    check_code_array,
    check_filled,
    check_lines,
    check_offset_array,
    check_point_array,
)
from contourpy.types import code_dtype, offset_dtype, point_dtype


def test_check_code_array() -> None:
    # Valid code array, does not raise.
    check_code_array(np.array([1, 2, 79], dtype=code_dtype))

    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'>"):
        check_code_array([1, 2, 79])

    with pytest.raises(ValueError, match=r"Expected numpy array of dtype <class 'numpy.uint8'>"):
        check_code_array(np.array([1, 2, 79], dtype=np.int64))

    with pytest.raises(ValueError, match=r"Expected numpy array of shape"):
        check_code_array(np.array([[1, 2, 79]], dtype=code_dtype))

    with pytest.raises(ValueError, match=r"First element of code array must be 1"):
        check_code_array(np.array([2, 2, 79], dtype=code_dtype))


def test_check_offset_array() -> None:
    # Valid offset array, does not raise.
    check_offset_array(np.array([0, 5], dtype=offset_dtype))

    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'>"):
        check_offset_array([0, 5])

    with pytest.raises(ValueError, match=r"Expected numpy array of dtype <class 'numpy.uint32'>"):
        check_offset_array(np.array([0, 5], dtype=np.int64))

    with pytest.raises(ValueError, match=r"Expected numpy array of shape"):
        check_offset_array(np.array([[0], [5]], dtype=offset_dtype))

    with pytest.raises(ValueError, match=r"First element of offset array must be 0"):
        check_offset_array(np.array([1, 5], dtype=offset_dtype))


def test_check_point_array() -> None:
    # Valid point array, does not raise.
    check_point_array(np.array([[1.1, 2.2], [3.3, 4.4]], dtype=point_dtype))

    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'>"):
        check_point_array([[1.1, 2.2], [3.3, 4.4]])

    with pytest.raises(ValueError, match=r"Expected numpy array of dtype <class 'numpy.float64'>"):
        check_point_array(np.array([[1.1, 2.2], [3.3, 4.4]], dtype=np.float32))

    with pytest.raises(ValueError, match=r"Expected numpy array of shape"):
        check_point_array(np.array([[1.1, 2.2, 3.3, 4.4]], dtype=point_dtype))


def test_check_filled_OuterCode() -> None:
    # Valid filled, does not raise.
    points = np.array([[1.1, 2.2], [3.3, 4.4], [5.5, 6.6]], dtype=point_dtype)
    codes = np.array([1, 2, 79], dtype=code_dtype)
    check_filled(([points], [codes]), FillType.OuterCode)

    with pytest.raises(TypeError, match=r"Expected tuple not <class 'list'>"):
        check_filled([], FillType.OuterCode)
    with pytest.raises(ValueError, match=r"Expected tuple of length 2 not 3"):
        check_filled(([], [], []), FillType.OuterCode)
    with pytest.raises(TypeError, match=r"Expected tuple to contain 2 lists"):
        check_filled(([], None), FillType.OuterCode)
    with pytest.raises(ValueError, match=r"Expected 2 lists with same length"):
        check_filled(([1, 2, 3], [1, 2]), FillType.OuterCode)

    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'"):
        check_filled(([list(points)], [codes]), FillType.OuterCode)
    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'"):
        check_filled(([points], [list(codes)]), FillType.OuterCode)

    with pytest.raises(ValueError, match=r"Points and codes have different lengths in polygon 0"):
        check_filled(([points], [codes[:-1]]), FillType.OuterCode)


def test_check_filled_OuterOffset() -> None:
    # Valid filled, does not raise.
    points = np.array([[1.1, 2.2], [3.3, 4.4], [5.5, 6.6], [7.7, 8.8]], dtype=point_dtype)
    offsets = np.array([0, 2, 4], dtype=offset_dtype)
    check_filled(([points], [offsets]), FillType.OuterOffset)

    with pytest.raises(TypeError, match=r"Expected tuple not <class 'list'>"):
        check_filled([], FillType.OuterOffset)
    with pytest.raises(ValueError, match=r"Expected tuple of length 2 not 3"):
        check_filled(([], [], []), FillType.OuterOffset)
    with pytest.raises(TypeError, match=r"Expected tuple to contain 2 lists"):
        check_filled(([], None), FillType.OuterOffset)
    with pytest.raises(ValueError, match=r"Expected 2 lists with same length"):
        check_filled(([1, 2, 3], [1, 2]), FillType.OuterOffset)

    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'"):
        check_filled(([list(points)], [offsets]), FillType.OuterOffset)
    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'"):
        check_filled(([points], [list(offsets)]), FillType.OuterOffset)

    with pytest.raises(ValueError, match=r"Inconsistent points and offsets in polygon 0"):
        check_filled(([points], [offsets[:-1]]), FillType.OuterOffset)


def test_check_filled_ChunkCombinedCode() -> None:
    # Valid filled, does not raise.
    points = np.array([[1.1, 2.2], [3.3, 4.4], [5.5, 6.6]], dtype=point_dtype)
    codes = np.array([1, 2, 79], dtype=code_dtype)
    check_filled(([points], [codes]), FillType.ChunkCombinedCode)
    check_filled(([None], [None]), FillType.ChunkCombinedCode)
    check_filled(([None, points], [None, codes]), FillType.ChunkCombinedCode)

    with pytest.raises(TypeError, match=r"Expected tuple not <class 'list'>"):
        check_filled([], FillType.ChunkCombinedCode)
    with pytest.raises(ValueError, match=r"Expected tuple of length 2 not 3"):
        check_filled(([], [], []), FillType.ChunkCombinedCode)
    with pytest.raises(TypeError, match=r"Expected tuple to contain 2 lists"):
        check_filled(([], None), FillType.ChunkCombinedCode)
    with pytest.raises(ValueError, match=r"Expected 2 lists with same length"):
        check_filled(([1, 2, 3], [1, 2]), FillType.ChunkCombinedCode)
    with pytest.raises(ValueError, match=r"Expected 2 non-empty lists"):
        check_filled(([], []), FillType.ChunkCombinedCode)

    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'"):
        check_filled(([list(points)], [codes]), FillType.ChunkCombinedCode)
    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'"):
        check_filled(([points], [list(codes)]), FillType.ChunkCombinedCode)

    with pytest.raises(ValueError, match=r"Points and codes have different lengths in chunk 1"):
        check_filled(([None, points], [None, codes[:-1]]), FillType.ChunkCombinedCode)

    with pytest.raises(ValueError, match=r"Inconsistent Nones in chunk 0"):
        check_filled(([points], [None]), FillType.ChunkCombinedCode)
    with pytest.raises(ValueError, match=r"Inconsistent Nones in chunk 0"):
        check_filled(([None], [codes]), FillType.ChunkCombinedCode)


def test_check_filled_ChunkCombinedOffset() -> None:
    # Valid filled, does not raise.
    points = np.array([[1.1, 2.2], [3.3, 4.4], [5.5, 6.6], [7.7, 8.8]], dtype=point_dtype)
    offsets = np.array([0, 2, 4], dtype=offset_dtype)
    check_filled(([points], [offsets]), FillType.ChunkCombinedOffset)
    check_filled(([None], [None]), FillType.ChunkCombinedOffset)
    check_filled(([None, points], [None, offsets]), FillType.ChunkCombinedOffset)

    with pytest.raises(TypeError, match=r"Expected tuple not <class 'list'>"):
        check_filled([], FillType.ChunkCombinedOffset)
    with pytest.raises(ValueError, match=r"Expected tuple of length 2 not 3"):
        check_filled(([], [], []), FillType.ChunkCombinedOffset)
    with pytest.raises(TypeError, match=r"Expected tuple to contain 2 lists"):
        check_filled(([], None), FillType.ChunkCombinedOffset)
    with pytest.raises(ValueError, match=r"Expected 2 lists with same length"):
        check_filled(([1, 2, 3], [1, 2]), FillType.ChunkCombinedOffset)
    with pytest.raises(ValueError, match=r"Expected 2 non-empty lists"):
        check_filled(([], []), FillType.ChunkCombinedOffset)

    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'"):
        check_filled(([list(points)], [offsets]), FillType.ChunkCombinedOffset)
    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'"):
        check_filled(([points], [list(offsets)]), FillType.ChunkCombinedOffset)

    with pytest.raises(ValueError, match=r"Inconsistent points and offsets in chunk 1"):
        check_filled(([None, points], [None, offsets[:-1]]), FillType.ChunkCombinedOffset)

    with pytest.raises(ValueError, match=r"Inconsistent Nones in chunk 0"):
        check_filled(([points], [None]), FillType.ChunkCombinedOffset)
    with pytest.raises(ValueError, match=r"Inconsistent Nones in chunk 0"):
        check_filled(([None], [offsets]), FillType.ChunkCombinedOffset)


def test_check_filled_ChunkCombinedCodeOffset() -> None:
    # Valid filled, does not raise.
    points = np.array([[1.1, 2.2], [3.3, 4.4], [5.5, 6.6], [7.7, 8.8]], dtype=point_dtype)
    codes = np.array([1, 2, 1, 79], dtype=code_dtype)
    outer_offsets = np.array([0, 4], dtype=offset_dtype)
    check_filled(([points], [codes], [outer_offsets]), FillType.ChunkCombinedCodeOffset)
    check_filled(([None], [None], [None]), FillType.ChunkCombinedCodeOffset)
    check_filled(([None, points], [None, codes], [None, outer_offsets]),
                 FillType.ChunkCombinedCodeOffset)

    with pytest.raises(TypeError, match=r"Expected tuple not <class 'list'>"):
        check_filled([], FillType.ChunkCombinedCodeOffset)
    with pytest.raises(ValueError, match=r"Expected tuple of length 3 not 2"):
        check_filled(([], []), FillType.ChunkCombinedCodeOffset)
    with pytest.raises(TypeError, match=r"Expected tuple to contain 3 lists"):
        check_filled(([], None, []), FillType.ChunkCombinedCodeOffset)
    with pytest.raises(ValueError, match=r"Expected 3 lists with same length"):
        check_filled(([1, 2, 3], [1, 2], [1, 2, 3]), FillType.ChunkCombinedCodeOffset)
    with pytest.raises(ValueError, match=r"Expected 3 non-empty lists"):
        check_filled(([], [], []), FillType.ChunkCombinedCodeOffset)

    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'"):
        check_filled(([list(points)], [codes], [outer_offsets]), FillType.ChunkCombinedCodeOffset)
    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'"):
        check_filled(([points], [list(codes)], [outer_offsets]), FillType.ChunkCombinedCodeOffset)
    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'"):
        check_filled(([points], [codes], [list(outer_offsets)]), FillType.ChunkCombinedCodeOffset)

    with pytest.raises(ValueError, match=r"Points and codes have different lengths in chunk 1"):
        check_filled(([None, points], [None, codes[:-1]], [None, outer_offsets]),
                     FillType.ChunkCombinedCodeOffset)
    with pytest.raises(ValueError, match=r"Inconsistent codes and outer_offsets in chunk 0"):
        check_filled(([points], [codes], [np.array([0, 4, 5], dtype=offset_dtype)]),
                     FillType.ChunkCombinedCodeOffset)

    with pytest.raises(ValueError, match=r"Inconsistent Nones in chunk 0"):
        check_filled(([points], [codes], [None]), FillType.ChunkCombinedCodeOffset)
    with pytest.raises(ValueError, match=r"Inconsistent Nones in chunk 0"):
        check_filled(([points], [None], [outer_offsets]), FillType.ChunkCombinedCodeOffset)
    with pytest.raises(ValueError, match=r"Inconsistent Nones in chunk 0"):
        check_filled(([None], [codes], [outer_offsets]), FillType.ChunkCombinedCodeOffset)


def test_check_filled_ChunkCombinedOffsetOffset() -> None:
    # Valid filled, does not raise.
    points = np.array([[1.1, 2.2], [3.3, 4.4], [5.5, 6.6], [7.7, 8.8]], dtype=point_dtype)
    offsets = np.array([0, 2, 4], dtype=offset_dtype)
    outer_offsets = np.array([0, 2], dtype=offset_dtype)
    check_filled(([points], [offsets], [outer_offsets]), FillType.ChunkCombinedOffsetOffset)
    check_filled(([None], [None], [None]), FillType.ChunkCombinedOffsetOffset)
    check_filled(([None, points], [None, offsets], [None, outer_offsets]),
                 FillType.ChunkCombinedOffsetOffset)

    with pytest.raises(TypeError, match=r"Expected tuple not <class 'list'>"):
        check_filled([], FillType.ChunkCombinedOffsetOffset)
    with pytest.raises(ValueError, match=r"Expected tuple of length 3 not 2"):
        check_filled(([], []), FillType.ChunkCombinedOffsetOffset)
    with pytest.raises(TypeError, match=r"Expected tuple to contain 3 lists"):
        check_filled(([], None, []), FillType.ChunkCombinedOffsetOffset)
    with pytest.raises(ValueError, match=r"Expected 3 lists with same length"):
        check_filled(([1, 2, 3], [1, 2], [1, 2, 3]), FillType.ChunkCombinedOffsetOffset)
    with pytest.raises(ValueError, match=r"Expected 3 non-empty lists"):
        check_filled(([], [], []), FillType.ChunkCombinedOffsetOffset)

    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'"):
        check_filled(([list(points)], [offsets], [outer_offsets]),
                      FillType.ChunkCombinedOffsetOffset)
    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'"):
        check_filled(([points], [list(offsets)], [outer_offsets]),
                      FillType.ChunkCombinedOffsetOffset)
    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'"):
        check_filled(([points], [offsets], [list(outer_offsets)]),
                      FillType.ChunkCombinedOffsetOffset)

    with pytest.raises(ValueError, match=r"Inconsistent points and offsets in chunk 1"):
        check_filled(([None, points], [None, offsets[:-1]], [None, outer_offsets]),
                     FillType.ChunkCombinedOffsetOffset)
    with pytest.raises(ValueError, match=r"Inconsistent offsets and outer_offsets in chunk 0"):
        check_filled(([points], [offsets], [np.array([0, 4, 5], dtype=offset_dtype)]),
                     FillType.ChunkCombinedOffsetOffset)

    with pytest.raises(ValueError, match=r"Inconsistent Nones in chunk 0"):
        check_filled(([points], [offsets], [None]), FillType.ChunkCombinedOffsetOffset)
    with pytest.raises(ValueError, match=r"Inconsistent Nones in chunk 0"):
        check_filled(([points], [None], [outer_offsets]), FillType.ChunkCombinedOffsetOffset)
    with pytest.raises(ValueError, match=r"Inconsistent Nones in chunk 0"):
        check_filled(([None], [offsets], [outer_offsets]), FillType.ChunkCombinedOffsetOffset)


def test_check_lines_Separate() -> None:
    # Valid lines, does not raise.
    points = np.array([[1.1, 2.2], [3.3, 4.4]], dtype=point_dtype)
    check_lines([points], LineType.Separate)

    with pytest.raises(TypeError, match=r"Expected list not <class 'tuple'>"):
        check_lines((), LineType.Separate)

    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'>"):
        check_lines([[]], LineType.Separate)


def test_check_lines_SeparateCode() -> None:
    # Valid lines, does not raise.
    points = np.array([[1.1, 2.2], [3.3, 4.4], [5.5, 6.6]], dtype=point_dtype)
    codes = np.array([1, 2, 79], dtype=code_dtype)
    check_lines(([points], [codes]), LineType.SeparateCode)

    with pytest.raises(TypeError, match=r"Expected tuple not <class 'list'>"):
        check_lines([], LineType.SeparateCode)
    with pytest.raises(ValueError, match=r"Expected tuple of length 2 not 3"):
        check_lines(([], [], []), LineType.SeparateCode)
    with pytest.raises(TypeError, match=r"Expected tuple to contain 2 lists"):
        check_lines(([], None), LineType.SeparateCode)
    with pytest.raises(ValueError, match=r"Expected 2 lists with same length"):
        check_lines(([1, 2, 3], [1, 2]), LineType.SeparateCode)

    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'"):
        check_lines(([list(points)], [codes]), LineType.SeparateCode)
    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'"):
        check_lines(([points], [list(codes)]), LineType.SeparateCode)

    with pytest.raises(ValueError, match=r"Points and codes have different lengths in line 0"):
        check_lines(([points], [codes[:-1]]), LineType.SeparateCode)


def test_check_lines_ChunkCombinedCode() -> None:
    # Valid lines, does not raise.
    points = np.array([[1.1, 2.2], [3.3, 4.4], [5.5, 6.6], [7.7, 8.8]], dtype=point_dtype)
    codes = np.array([1, 2, 1, 2], dtype=code_dtype)
    check_lines(([points], [codes]), LineType.ChunkCombinedCode)
    check_lines(([None], [None]), LineType.ChunkCombinedCode)
    check_lines(([None, points], [None, codes]), LineType.ChunkCombinedCode)

    with pytest.raises(TypeError, match=r"Expected tuple not <class 'list'>"):
        check_lines([], LineType.ChunkCombinedCode)
    with pytest.raises(ValueError, match=r"Expected tuple of length 2 not 3"):
        check_lines(([], [], []), LineType.ChunkCombinedCode)
    with pytest.raises(TypeError, match=r"Expected tuple to contain 2 lists"):
        check_lines(([], None), LineType.ChunkCombinedCode)
    with pytest.raises(ValueError, match=r"Expected 2 lists with same length"):
        check_lines(([None, None], [None]), LineType.ChunkCombinedCode)
    with pytest.raises(ValueError, match=r"Expected 2 non-empty lists"):
        check_lines(([], []), LineType.ChunkCombinedCode)

    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'>"):
        check_lines(([list(points)], [codes]), LineType.ChunkCombinedCode)
    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'>"):
        check_lines(([points], [list(codes)]), LineType.ChunkCombinedCode)

    with pytest.raises(ValueError, match=r"Points and codes have different lengths in chunk 1"):
        check_lines(([None, points], [None, codes[:-1]]), LineType.ChunkCombinedCode)

    with pytest.raises(ValueError, match=r"Inconsistent Nones in chunk 0"):
        check_lines(([points], [None]), LineType.ChunkCombinedCode)
    with pytest.raises(ValueError, match=r"Inconsistent Nones in chunk 0"):
        check_lines(([None], [codes]), LineType.ChunkCombinedCode)


def test_check_lines_ChunkCombinedOffset() -> None:
    # Valid lines, does not raise.
    points = np.array([[1.1, 2.2], [3.3, 4.4], [5.5, 6.6], [7.7, 8.8]], dtype=point_dtype)
    offsets = np.array([0, 2, 4], dtype=offset_dtype)
    check_lines(([points], [offsets]), LineType.ChunkCombinedOffset)
    check_lines(([None], [None]), LineType.ChunkCombinedOffset)
    check_lines(([None, points], [None, offsets]), LineType.ChunkCombinedOffset)

    with pytest.raises(TypeError, match=r"Expected tuple not <class 'list'>"):
        check_lines([], LineType.ChunkCombinedOffset)
    with pytest.raises(ValueError, match=r"Expected tuple of length 2 not 3"):
        check_lines(([], [], []), LineType.ChunkCombinedOffset)
    with pytest.raises(TypeError, match=r"Expected tuple to contain 2 lists"):
        check_lines(([], None), LineType.ChunkCombinedOffset)
    with pytest.raises(ValueError, match=r"Expected 2 lists with same length"):
        check_lines(([None, None], [None]), LineType.ChunkCombinedOffset)
    with pytest.raises(ValueError, match=r"Expected 2 non-empty lists"):
        check_lines(([], []), LineType.ChunkCombinedOffset)

    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'>"):
        check_lines(([list(points)], [offsets]), LineType.ChunkCombinedOffset)
    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'>"):
        check_lines(([points], [list(offsets)]), LineType.ChunkCombinedOffset)

    with pytest.raises(ValueError, match=r"Inconsistent points and offsets in chunk 1"):
        check_lines(([None, points], [None, offsets[:-1]]), LineType.ChunkCombinedOffset)

    with pytest.raises(ValueError, match=r"Inconsistent Nones in chunk 0"):
        check_lines(([points], [None]), LineType.ChunkCombinedOffset)
    with pytest.raises(ValueError, match=r"Inconsistent Nones in chunk 0"):
        check_lines(([None], [offsets]), LineType.ChunkCombinedOffset)


def test_check_lines_ChunkCombinedNan() -> None:
    # Valid lines, does not raise.
    points = np.array([[1.1, 2.2], [3.3, 4.4], [np.nan, np.nan], [5.5, 6.6], [7.7, 8.8]],
                       dtype=point_dtype)
    check_lines(([points],), LineType.ChunkCombinedNan)
    check_lines(([None],), LineType.ChunkCombinedNan)
    check_lines(([None, points],), LineType.ChunkCombinedNan)

    with pytest.raises(TypeError, match=r"Expected tuple not <class 'list'>"):
        check_lines([], LineType.ChunkCombinedNan)
    with pytest.raises(ValueError, match=r"Expected tuple of length 1 not 2"):
        check_lines(([], []), LineType.ChunkCombinedNan)
    with pytest.raises(TypeError, match=r"Expected tuple to contain 1 lists"):
        check_lines((None,), LineType.ChunkCombinedNan)
    with pytest.raises(ValueError, match=r"Expected 1 non-empty lists"):
        check_lines(([],), LineType.ChunkCombinedNan)

    with pytest.raises(TypeError, match=r"Expected numpy array not <class 'list'>"):
        check_lines(([list(points)],), LineType.ChunkCombinedNan)