Skip to content

Commit

Permalink
speed up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Kay-Robert Dormann committed Oct 22, 2024
1 parent 889dfb7 commit 8b0fe49
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
6 changes: 3 additions & 3 deletions test/test_evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ def msd(frame, start=None):
msd_eval.name = "msd"
msd_eval.save(RESULT_DIR/"msd_eval.h5")
pcf2d = PCF2d(traj,
nav=2, nxbins=2000, nybins=2000,
nav=2, nxbins=50, nybins=50,
njobs=4, skip=0.9
)
pcf2d.save(RESULT_DIR/"pcf2d.h5")
pcfangle = PCFangle(
traj, nav=2, ndbins=1000, nabins=1000,
traj, nav=2, ndbins=50, nabins=50,
njobs=4, rmax=8.0, skip=0.9
)
pcfangle.save(RESULT_DIR/"pcfangle.h5")
Expand All @@ -109,7 +109,7 @@ def test_correlation(self):
"""Test order parameter evaluation.
TO BE IMPLEMENTED
"""
svc = SpatialVelCor(self.particle_traj, skip=0.9, nav=5, njobs=4)
svc = SpatialVelCor(self.particle_traj, skip=0.9, nav=2, njobs=4)

svc.save(RESULT_DIR/"svc.h5")
rdfcalc = RDF(
Expand Down
4 changes: 2 additions & 2 deletions test/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ def test_animation(self):
p_trajectory = choice([traj for traj in self.trajs
if isinstance(traj, ParticleTrajectory)])
out_particles = PLOT_DIR/"particle_vid.gif"
plot.animate_trajectory(f_trajectory, out_field, ftype="c")
plot.animate_trajectory(p_trajectory, out_particles)
plot.animate_trajectory(f_trajectory, out_field, ftype="c", nth=10)
plot.animate_trajectory(p_trajectory, out_particles, nth=50)

def test_ll_video(self):
"""Test the low level video interface."""
Expand Down
6 changes: 1 addition & 5 deletions test/test_trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,7 @@ def test_ptype_type(self):
f'''Invalid type. Got {type(self.traj.get_particle_info(1))}
instead of dict.'''
)
self.assertTrue(
isinstance(self.traj.get_particle_info("asdf"), dict),
f'''Invalid type. Got {type(self.traj.get_particle_info(1))}
instead of dict.'''
)
self.assertRaises(TypeError, self.traj.get_particle_info, "asdf")

def test_delete_particle_info(self):
# delete particle info
Expand Down

0 comments on commit 8b0fe49

Please sign in to comment.