-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add seed parameter and kwargs to Pack #184
base: main
Are you sure you want to change the base?
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start! Left some comments
self.fix_orientation = fix_orientation | ||
super(Pack, self).__init__(molecules=molecules, base_units=base_units) | ||
|
||
def _build_system(self): | ||
def _build_system(self, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll have to put this in the __init__()
method for Pack
after all of the other parameters. Assign it to a class variable with self
then use that in fill_box
edge=self.edge, | ||
fix_orientation=self.fix_orientation, | ||
**kwargs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment above.
benzene_mol = benzene_molecule(n_mols=3) | ||
default_seed = Pack(molecules=[benzene_mol], density=0.1) | ||
change_seed = Pack(molecules=[benzene_mol], density=0.1, seed=12340) | ||
assert np.prod(low_density_system.box.lengths) > np.prod( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, instead of testing box lengths (which should be the same regardless of seed
), let's test the positions of the system and make sure they are different.
Using something like np.array
Something along the lines of this:
assert not np.array_equal(system_one.xyz, sytem_two.xyz)
Solves #183.