-
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
Use FlattenedStorage in NeighborsTrajectory #387
Conversation
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 looks good to me. If possible, can you also add a test to check if the shapes are consistent?
I realize now that this will change the shape of the attributes What if I make it so that the property methods check whether the trajectory canonical or grand-canonical and in the latter case return full arrays with filler values (basically like @samwaseda does it for the neighbor class). Then old code won't break and new code that wants to deal with grand-canonical trajectories is better off dealing with the underlying |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
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.
LGTM!
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.
Oops one of the tests fail
AttributeError: 'float' object has no attribute 'sqrt'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/runner/work/pyiron_atomistics/pyiron_atomistics/tests/lammps/test_base.py", line 412, in test_dump_parser_water
self.assertTrue(np.allclose(np.linalg.norm(neigh_traj_obj.vecs, axis=-1),
File "<__array_function__ internals>", line 5, in norm
File "/usr/share/miniconda/envs/test/lib/python3.9/site-packages/numpy/linalg/linalg.py", line 2561, in norm
return sqrt(add.reduce(s, axis=axis, keepdims=keepdims))
TypeError: loop of ufunc does not support argument 0 of type float which has no callable sqrt method
Seems it's a bug in |
Enables the class to be used for grand-canonical trajectories as well.
This is necessary to allow correct loading from HDF.
This makes sure, it will be correctly saved/loaded to/from HDF.
When a predefined store is used, make sure to call add_chunk only when there's more structures in has_structure then chunks already exist in store. Assuming that the given store already holds some information about the structures in has_structure, this ensures that the neighbor information lines up with that.
Pull Request Test Coverage Report for Build 1507327506
💛 - Coveralls |
This also allows it to be used with grand-canonical trajectories. Has some small fixes for DataContainer compat too, see commit messages.