@@ -186,7 +186,7 @@ def test_to_mask(self):
186
186
187
187
188
188
class TestTriangularMeshes :
189
- def test_init (self ):
189
+ def test_api (self ):
190
190
# Tetrahedron
191
191
coords = np .array (
192
192
[
@@ -227,6 +227,36 @@ def test_init(self):
227
227
assert tm2 .n_triangles == 4
228
228
assert tm3 .n_triangles == 4
229
229
230
+ out_coords , out_tris = tm1 .get_mesh ()
231
+ # Currently these are the exact arrays, but I don't think we should
232
+ # bake that assumption into the tests
233
+ assert np .allclose (out_coords , coords )
234
+ assert np .allclose (out_tris , triangles )
235
+
236
+
237
+ class TestCoordinateFamilyMixin (TestPointsets ):
238
+ def test_names (self ):
239
+ coords = np .array (
240
+ [
241
+ [0.0 , 0.0 , 0.0 ],
242
+ [0.0 , 0.0 , 1.0 ],
243
+ [0.0 , 1.0 , 0.0 ],
244
+ [1.0 , 0.0 , 0.0 ],
245
+ ]
246
+ )
247
+ cfm = ps .CoordinateFamilyMixin (coords )
248
+
249
+ assert cfm .get_names () == ['original' ]
250
+ assert np .allclose (cfm .with_name ('original' ).coordinates , coords )
251
+
252
+ cfm .add_coordinates ('shifted' , coords + 1 )
253
+ assert cfm .get_names () == ['original' , 'shifted' ]
254
+ shifted = cfm .with_name ('shifted' )
255
+ assert np .allclose (shifted .coordinates , coords + 1 )
256
+ assert shifted .get_names () == ['original' , 'shifted' ]
257
+ original = shifted .with_name ('original' )
258
+ assert np .allclose (original .coordinates , coords )
259
+
230
260
231
261
class H5ArrayProxy :
232
262
def __init__ (self , file_like , dataset_name ):
0 commit comments