diff --git a/tests/integration/baseline_images/plot_test/msd.png b/tests/integration/baseline_images/plot_test/msd.png index 0825d98d..79c69df4 100644 Binary files a/tests/integration/baseline_images/plot_test/msd.png and b/tests/integration/baseline_images/plot_test/msd.png differ diff --git a/tests/integration/baseline_images/plot_test/shape.png b/tests/integration/baseline_images/plot_test/shape.png index 725a0013..ef31c65a 100644 Binary files a/tests/integration/baseline_images/plot_test/shape.png and b/tests/integration/baseline_images/plot_test/shape.png differ diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 87053f84..e9f383d5 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -76,9 +76,13 @@ def vasp_rdf_data(vasp_traj, structure, vasp_transitions): trajectory=trajectory, floating_specie='Li') + transitions = Transitions.from_trajectory(trajectory=trajectory, + structure=structure, + floating_specie='Li') + rdfs = radial_distribution( sites=sites, - transitions=vasp_transitions, + transitions=transitions, max_dist=5, ) @@ -87,13 +91,13 @@ def vasp_rdf_data(vasp_traj, structure, vasp_transitions): @pytest.fixture(scope='module') def vasp_shape_data(vasp_traj): - trajectory = vasp_traj[-1000:] + trajectory = vasp_traj[-250:] trajectory.filter('Li') # shape analysis needs structure without supercell - structure = load_known_material('argyrodite') + sites = load_known_material('argyrodite') - sa = ShapeAnalyzer.from_structure(structure) + sa = ShapeAnalyzer.from_structure(sites) shapes = sa.analyze_trajectory(trajectory, supercell=(2, 1, 1)) diff --git a/tests/integration/plot_test.py b/tests/integration/plot_test.py index 773850ea..c295640d 100644 --- a/tests/integration/plot_test.py +++ b/tests/integration/plot_test.py @@ -1,6 +1,5 @@ from __future__ import annotations -import pytest from helpers import image_comparison2 from gemdat.io import load_known_material @@ -61,7 +60,6 @@ def test_jumps_3d_animation(vasp_jumps): plots.jumps_3d_animation(jumps=vasp_jumps, t_start=1000, t_stop=1001) -@pytest.mark.xfail(reason='Needs to be checked') @image_comparison2(baseline_images=['rdf1', 'rdf2', 'rdf3']) def test_rdf23(vasp_rdf_data): assert len(vasp_rdf_data) == 3 @@ -78,7 +76,7 @@ def test_shape(vasp_shape_data): @image_comparison2(baseline_images=['msd']) def test_msd_per_element(vasp_traj): - plots.msd_per_element(trajectory=vasp_traj) + plots.msd_per_element(trajectory=vasp_traj[-500:]) @image_comparison2(baseline_images=['path_energy']) diff --git a/tests/integration/shape_test.py b/tests/integration/shape_test.py index 6493c80f..7000c818 100644 --- a/tests/integration/shape_test.py +++ b/tests/integration/shape_test.py @@ -11,7 +11,7 @@ def test_shape(vasp_shape_data): for shape in vasp_shape_data: assert isinstance(shape, ShapeData) assert shape.name == '48h' - assert shape.coords.shape == (76610, 3) + assert shape.coords.shape == (19284, 3) # coords may not exceed threshold assert np.all(shape.coords > -1) diff --git a/tests/integration/trajectory_test.py b/tests/integration/trajectory_test.py index c35b6395..dc8998ed 100644 --- a/tests/integration/trajectory_test.py +++ b/tests/integration/trajectory_test.py @@ -119,9 +119,9 @@ def test_vibration_metrics(vasp_traj): @pytest.vaspxml_available # type: ignore def test_msd(vasp_traj): - msd = vasp_traj.mean_squared_displacement() + msd = vasp_traj[-100:].mean_squared_displacement() - assert msd.shape == (104, 3750) - assert np.isclose(msd[10, -1], 0.03396214706964429) - assert np.isclose(msd[52, -1], 0.30140820020960746) - assert np.isclose(msd[85, -1], 11.927261505164097) + assert msd.shape == (104, 100) + assert np.isclose(msd[10, -1], 0.0711843146266915) + assert np.isclose(msd[52, -1], 0.597740065985704) + assert np.isclose(msd[85, -1], 1.1881148711032665)