Пример #1
0
 def test_dynamo_snapshot():
     data = list(
         dynamo.read(
             "test/file_readers/test_files/sample_dynamo_snapshot.xml"))[0]
     assert np.allclose(data.box,
                        np.array([[0, 8.71188], [0, 8.71188], [0,
                                                               8.71188]]),
                        atol=0.00001)
     assert math.isclose(data.density, 2.075)
     assert data.diameters.shape == (1372, )
     assert data.dimensionality == 3
     assert data.num_particles == 1372
     assert data.particle_coordinates.shape == (1372, 3)
     assert data.species.shape == (1372, )
     assert math.isclose(data.volume, 661.204, rel_tol=0.001)
     assert math.isclose(data.volume_fraction, 0.5746, rel_tol=0.0001)
Пример #2
0
 def test_dynamo_config():
     data = list(
         dynamo.read(
             "test/file_readers/test_files/sample_dynamo_config.end.xml")
     )[0]
     assert np.allclose(data.box,
                        np.array([[0, 9.68024], [0, 9.68024], [0,
                                                               9.68024]]),
                        atol=0.00001)
     assert math.isclose(data.density, 1.5125)
     assert data.diameters.shape == (1372, )
     assert data.dimensionality == 3
     assert data.num_particles == 1372
     assert data.particle_coordinates.shape == (1372, 3)
     assert data.species.shape == (1372, )
     assert math.isclose(data.volume, 907.107, rel_tol=0.001)
     assert math.isclose(data.volume_fraction, 0.58617, rel_tol=0.0001)
Пример #3
0
 def test_empty_file():
     assert list(
         dynamo.read("test/file_readers/test_files/empty_file.xyz")) == []