-
Notifications
You must be signed in to change notification settings - Fork 82
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
Clarify default args for box in Compound.save() #676
Comments
It looks like there's a discrepancy between the Lines 2327 to 2332 in fe5292e
I think this is the right behavior (bounding boxes are bad and periodicity should be used if it exists). Exactly how the periodicity got set is more opaque, it looks like the packing functions set the periodicity of the returned compounds to the dimensions of the boxes you passed in, and adding compounds into that container just took in the values of the first thing added. But after adding a second compound, the periodicity wasn't updated. It looks like there's an argument to Lines 759 to 761 in fe5292e
You'd be able to use either |
This is still an issue, and leads to some ambiguity in the writers. This line shows that even if a box is not passed, the box of the compound can still be grabbed from compound.box. This should be a quick fix to the docs. if box is None:
if compound.box is not None:
box = deepcopy(compound.box)
else:
box = compound.get_boundingbox()
# Pad by an extra 0.5 nm (0.25 on each side) from bounding box
box = Box(lengths=np.array(box.lengths) + 0.5, angles=box.angles) |
Bug summary
Docstring says that the box arg defaults to
self.boundingbox
, but defaults to periodicity IRL. We should either use the bounding box or track the periodicity better when adding compounds.Docstring:
mbuild/mbuild/compound.py
Lines 1839 to 1842 in fe5292e
Where the actual box dims come from:
mbuild/mbuild/compound.py
Line 1929 in fe5292e
mbuild/mbuild/compound.py
Lines 2442 to 2454 in fe5292e
Code to reproduce the behavior
Output:
I'd expect the actual box lengths to be equal to the bounding box, but that's not the case.
The text was updated successfully, but these errors were encountered: