Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

StephMcCallum
Copy link

Solves #183.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Member

@chrisjonesBSU chrisjonesBSU left a 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):
Copy link
Member

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,
Copy link
Member

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(
Copy link
Member

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants