-
Notifications
You must be signed in to change notification settings - Fork 15
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
Pyscal solid liquid #414
Pyscal solid liquid #414
Conversation
sys.find_neighbors(method="voronoi") | ||
atoms = sys.atoms | ||
return np.array([atom.volume for atom in atoms]) | ||
|
||
def get_system(atoms): |
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.
I think for consistency we would want to call that pyiron_to_pyscal
, similar to pyiron_to_ase
and pyiron_to_pymatgen
.
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.
renamed it. I also moved it next to the to_ase, to_pymatgen and to_ovito methods
) | ||
return sys | ||
|
||
def analyse_find_solids(atoms, neighbor_method="cutoff", |
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 returns the number of atoms that are inside a solid phase? If so it'd cool to also return an index array, that shows which are solid and which are liquid, maybe behind a switch, like the pyscal_adaptive_cna
method.
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 only returns the number by default, but when using return_system=True it returns the complete pyscal system object, which allows to get the indices. I thought this is the most simple in the default case and the most flexible approach when using the return_system option.
Alternatively I could change the default to return an array with the indices of all atoms that are identified as solid, so that the len(returned_array) gives the number of solids I guess. But I do not know if the order of the atoms stays the same when converting between pyiron ase and pyscal system, so I am not sure if indices will always be correct
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.
Ah, I had simply missed that while skimming. Since anything might happen while changing from pyiron to pyscal returning the full system is ok, I suppose.
return_sys=False, | ||
): | ||
""" | ||
Get the number of solids or the corresponding pyscal system. |
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.
Typo?
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.
what do you mean?
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.
Since I misunderstood the method, I thought or
should be of
or some such... I promise to read more carefully next time. ;)
Yep, once the h5io is sorted out, go ahead and merge. |
I fixed the h5io version (for now) in #410, thus, try to rerun the tests :) |
Pull Request Test Coverage Report for Build 1439141654
💛 - Coveralls |
Cool! We are really getting a lot of pyscal mapped functions -- what about doing a refactor (after this PR, not part of it) so that we nest these bindings, i.e. |
I always tried to type exactly that. |
Adds pyscals ability to find solid and liquid atoms in a structure.
Also adds a get_system convenience function to have easier access to pyscal functionality that is not directly accessible and replaces repetitive code with the get_system function.