-
Notifications
You must be signed in to change notification settings - Fork 3
Add from_matrix class method to Box. #81
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
Conversation
mphoward
left a comment
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.
Overall looks good! I have two comments below, and there is a documentation build error that needs fixing. We should merge this branch before #80, as I think you will be able to use this method to implement the change in from_hoomd_gsd?
src/lammpsio/box.py
Outdated
|
|
||
| # Extract tilt factors | ||
| xy, xz, yz = arr[0, 1], arr[0, 2], arr[1, 2] | ||
| tilt = [xy, xz, yz] if numpy.any([xy, xz, yz]) else None |
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.
This is one area of LAMMPS that is slightly grey. You may want to have a triclinic box that has zero tilt factors, say in order to allow the box to deform later.
Should we add a default argument like check_orthorhombic=True or force_triclinic=False that will cause this check to occur? And otherwise, accept the tilts as they come from the matrix?
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 point! I've implemented a force_triclinic argument to cover this scenario!
|
I've made these tweaks and fixed the documentation! This should go in before #80, and then I'll made the edits there! |
mphoward
left a comment
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.
Thanks! One small comment, then this can be merged.
Adds a method to create a
lammpio.Boxobject from a box matrix.