Closed davidbbeyer closed 2 months ago
thanks @davidbbeyer for taking care of this, we should make a couple of CI tests for this:
center_molecule_in_simulation_box
places the molecule in the center of the simulation box, for both cubic and non cubic simulation boxes. Probably could be part of testsuite/create_molecule_position_test.py
SEED
. I am not completely sure what is the best way we could check this. A simple test could be to create a somewhat complex molecule twice into espresso with two different instances of pyMBE with the same SEED
and check that one gets the same structure @pm-blanco I have implemented your suggestions:
testsuite/create_molecule_position_test.py
now contains two tests that check if the function center_molecule_in_simulation_box
works correctly. Note that I had to slightly modify the function center_molecule_in_simulation_box
, since it was performing a check that was not strictly necessary and in some cases might cause that the molecule is not centered in the box (depending on the order that objects with a given molecule id are added to the dataframe). I also adjusted the function create_molecule
such that the returned dictionary now actually matches the description in the docstring.
I added a test testsuite/seed_test.py
that checks if a molecule is created at exactly the same position if the same global seed is provided to pyMBE.
Solves #44, #43
@pm-blanco I have made the
SEED
a mandatory attribute of thepmb
class, which is now used to set up the various reaction methods. Furthermore, I have added an attributerng
that is initialized using the providedSEED
and used ingenerate_random_points_in_a_sphere
. This way it is avoided that therng
, which was before initialized withingenerate_random_points_in_a_sphere
, is each time re-initialized with the same seed.All samples, tests, etc. have been updated accordingly.
Moreover, I have also fixed the bug discovered by @kosovan regarding non-cubic simulation boxes (#43)