-
Notifications
You must be signed in to change notification settings - Fork 192
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
Limit ArrayData to a single array? #3213
Comments
Hi Conrad, thanks a lot for the suggestion! Here is the reasoning: there are cases (e.g. a trajectory data) where multiple arrays make sense only together (both in terms of the length of one of their dimensions, but also physically). I see two options:
I hope this helps. I'll keep this issue open for a while for discussion, then in a few weeks we'll decide if we'll make a wontfix or we convert to a real issue. |
Hi @giovannipizzi , Thanks for your input. Yes, I do indeed see the value of keeping related arrays together for the likes of trajectories. When I was thinking about this previously, I was focused on volumetric data like electron density, etc. Originally, I was thinking that ArrayData should be a collection of some SingleArrayData objects, but I appreciate now that this could be a bit ridiculous for the DB and for the graph. If you think it's worth having a SingleArrayData convenience class, I'll have a crack at some point. I suppose the nice thing about adding, rather than changing, is that you don't risk breaking anyone's plugin. |
In #6097 and a related PR I implemented functionality that essentially covers your use case. If an |
Perhaps this in an unpopular opinion, but what is the motivation for allowing multiple arrays to be stored in a single ArrayData object?
In the use case where there is only one array, one of the tedious consequences is needing to keep track of the name of that array.
For example:
I know one can get the names of the stored arrays, but that adds more machinery to what should be a simple operation. In my mind, an ArrayData should represent only one array and so this code should look more like this:
This would be much more consistent with how Numpy works and would be more intuitive for users.
If there is a need to store many arrays, then this should be a different data object, in the same way that TrajectoryData is a separate class from StructureData.
Comments, queries, and abuse on a postcard, please?
The text was updated successfully, but these errors were encountered: