You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many file formats do not always store a bounding box. I think it would be a significant usability improvement if getting the cell from a frame behaved the same way as getting the velocities (#25).
Currently, if the frame does not contain a cell it will silently return a default cell that is initialized with all matrix elements set to zero. In order to check for this one must iterate over the matrix elements and assume that a matrix full of zeros means the cell was not found in the file.
I would be happy to make a pull request that addresses this from the Rust side if it is something that doesn't need to be handled in the underlying C++ code.
The text was updated successfully, but these errors were encountered:
The way this is handled in chemfiles is with the CellShape enum, where an Infinite cell correspond to non-periodic systems. Would checking this first work for you?
We could also change the return type of UnitCell::matrix() to be an option, returning None when the cell is infinite.
Thanks for the clarification. Checking the CellShape enum will work for my purposes but I also like the idea of returning an option from UnitCell::matrix(). To me that seems like a more rust-y approach than returning a default value.
Many file formats do not always store a bounding box. I think it would be a significant usability improvement if getting the cell from a frame behaved the same way as getting the velocities (#25).
Currently, if the frame does not contain a cell it will silently return a default cell that is initialized with all matrix elements set to zero. In order to check for this one must iterate over the matrix elements and assume that a matrix full of zeros means the cell was not found in the file.
I would be happy to make a pull request that addresses this from the Rust side if it is something that doesn't need to be handled in the underlying C++ code.
The text was updated successfully, but these errors were encountered: