@@ -124,7 +124,7 @@ def test_triangular_dataset(tmp_path, ds_name):
124
124
assert tri_grid .bounds == ((0.0 , 0.0 , 0.0 ), (1.0 , 0.0 , 1.0 ))
125
125
assert np .all (tri_grid ._vtk_offsets == np .array ([0 , 3 , 6 ]))
126
126
127
- if vtk is None :
127
+ if vtk [ "mod" ] is None :
128
128
with pytest .raises (Tidy3dImportError ):
129
129
_ = tri_grid ._vtk_cells
130
130
with pytest .raises (Tidy3dImportError ):
@@ -137,7 +137,7 @@ def test_triangular_dataset(tmp_path, ds_name):
137
137
_ = tri_grid ._vtk_obj
138
138
139
139
# plane slicing
140
- if vtk is None :
140
+ if vtk [ "mod" ] is None :
141
141
with pytest .raises (Tidy3dImportError ):
142
142
_ = tri_grid .plane_slice (axis = 2 , pos = 0.5 )
143
143
else :
@@ -154,7 +154,7 @@ def test_triangular_dataset(tmp_path, ds_name):
154
154
_ = tri_grid .plane_slice (axis = 0 , pos = 2 )
155
155
156
156
# clipping by a box
157
- if vtk is None :
157
+ if vtk [ "mod" ] is None :
158
158
with pytest .raises (Tidy3dImportError ):
159
159
_ = tri_grid .box_clip ([[0.1 , - 0.2 , 0.1 ], [0.2 , 0.2 , 0.9 ]])
160
160
else :
@@ -166,7 +166,7 @@ def test_triangular_dataset(tmp_path, ds_name):
166
166
_ = tri_grid .box_clip ([[0.1 , 0.1 , 0.3 ], [0.2 , 0.2 , 0.9 ]])
167
167
168
168
# interpolation
169
- if vtk is None :
169
+ if vtk [ "mod" ] is None :
170
170
with pytest .raises (Tidy3dImportError ):
171
171
invariant = tri_grid .interp (
172
172
x = 0.4 , y = [0 , 1 ], z = np .linspace (0.2 , 0.6 , 10 ), fill_value = - 333
@@ -224,7 +224,7 @@ def test_triangular_dataset(tmp_path, ds_name):
224
224
_ = tri_grid .plot (field = False , grid = False )
225
225
226
226
# generalized selection method
227
- if vtk is None :
227
+ if vtk [ "mod" ] is None :
228
228
with pytest .raises (Tidy3dImportError ):
229
229
_ = tri_grid .sel (x = 0.2 )
230
230
else :
@@ -238,7 +238,7 @@ def test_triangular_dataset(tmp_path, ds_name):
238
238
_ = tri_grid .sel (x = np .linspace (0 , 1 , 3 ), y = 1.2 , z = [0.3 , 0.4 , 0.5 ])
239
239
240
240
# writting/reading .vtu
241
- if vtk is None :
241
+ if vtk [ "mod" ] is None :
242
242
with pytest .raises (Tidy3dImportError ):
243
243
tri_grid .to_vtu (tmp_path / "tri_grid_test.vtu" )
244
244
with pytest .raises (Tidy3dImportError ):
@@ -362,7 +362,7 @@ def test_tetrahedral_dataset(tmp_path, ds_name):
362
362
assert np .all (tet_grid ._vtk_offsets == np .array ([0 , 4 , 8 ]))
363
363
assert tet_grid .name == ds_name
364
364
365
- if vtk is None :
365
+ if vtk [ "mod" ] is None :
366
366
with pytest .raises (Tidy3dImportError ):
367
367
_ = tet_grid ._vtk_cells
368
368
with pytest .raises (Tidy3dImportError ):
@@ -375,7 +375,7 @@ def test_tetrahedral_dataset(tmp_path, ds_name):
375
375
_ = tet_grid ._vtk_obj
376
376
377
377
# plane slicing
378
- if vtk is None :
378
+ if vtk [ "mod" ] is None :
379
379
with pytest .raises (Tidy3dImportError ):
380
380
_ = tet_grid .plane_slice (axis = 2 , pos = 0.5 )
381
381
else :
@@ -387,7 +387,7 @@ def test_tetrahedral_dataset(tmp_path, ds_name):
387
387
_ = tet_grid .plane_slice (axis = 1 , pos = 2 )
388
388
389
389
# clipping by a box
390
- if vtk is None :
390
+ if vtk [ "mod" ] is None :
391
391
with pytest .raises (Tidy3dImportError ):
392
392
_ = tet_grid .box_clip ([[0.1 , - 0.2 , 0.1 ], [0.2 , 0.2 , 0.9 ]])
393
393
else :
@@ -399,7 +399,7 @@ def test_tetrahedral_dataset(tmp_path, ds_name):
399
399
_ = tet_grid .box_clip ([[0.1 , 1.1 , 0.3 ], [0.2 , 1.2 , 0.9 ]])
400
400
401
401
# interpolation
402
- if vtk is None :
402
+ if vtk [ "mod" ] is None :
403
403
with pytest .raises (Tidy3dImportError ):
404
404
_ = tet_grid .interp (x = 0.4 , y = [0 , 1 ], z = np .linspace (0.2 , 0.6 , 10 ), fill_value = - 333 )
405
405
else :
@@ -415,7 +415,7 @@ def test_tetrahedral_dataset(tmp_path, ds_name):
415
415
assert no_intersection .name == ds_name
416
416
417
417
# generalized selection method
418
- if vtk is None :
418
+ if vtk [ "mod" ] is None :
419
419
with pytest .raises (Tidy3dImportError ):
420
420
_ = tet_grid .sel (x = 0.2 )
421
421
else :
@@ -429,7 +429,7 @@ def test_tetrahedral_dataset(tmp_path, ds_name):
429
429
_ = tet_grid .sel (x = 0.2 , z = [0.3 , 0.4 , 0.5 ])
430
430
431
431
# writting/reading .vtu
432
- if vtk is None :
432
+ if vtk [ "mod" ] is None :
433
433
with pytest .raises (Tidy3dImportError ):
434
434
tet_grid .to_vtu (tmp_path / "tet_grid_test.vtu" )
435
435
with pytest .raises (Tidy3dImportError ):
0 commit comments