amepproject / amep

The Active Matter Evaluation Package (AMEP) - a Python library for the analysis of particle-based and continuum simulation data of soft and active matter systems
https://amepproject.de/
GNU General Public License v3.0
9 stars 2 forks source link

BUG: evaluate.VelDist number of bins default causes error #32

Open kay-ro opened 1 month ago

kay-ro commented 1 month ago

Description:

If the VelDist class of the evaluate module gets a trajectory with fewer than 100 particles, the number of bins is set to 0 by default. This causes an unexpected behavior of the distribution function.

Code for reproduction:

import amep
traj = amep.load.traj("../examples/data/lammps.h5amep")
ld1 = amep.evaluate.VelDist(traj)

Error message:

No response

Python and AMEP versions:

any python version, AMEP 1.0.2

Additional information:

Can be easily fixed by setting the default number of bins nbins to 50 (analogous to the similar fix in evaluate.LDDist)

How did you install AMEP?

None