Closed dave452 closed 1 year ago
A few things to note (for myself, and to help address the comments):
Dataset
we assign units to each frame (frame.units)
, whether we use ASE or not, so the dictionary of units should always be accessible to change_units_all
n2p2
input files, we currently always assume the units are Bohr/Ha, unless each frame has a comment units
line
units
is also a valid argument for ASE's read, but it would never be passed with these changes, as units
would not be a kwarg, and so ASE would always assume the default units for the format
My feeling is that as long as we set the Frame units correctly, it shouldn't matter too much if ASE assumes the wrong units. We always call change_units_all
when units
is passed to dataset.write
, so this might actually prevent "double counting".
I might need to expand my changes to allow us to set non-n2p2 input units, but in terms of this PR's changes I'm not sure there should be a problem with regard to reading and writing. We might need to consider if there are occasions where we want to manipulate a Dataset
before writing, and if the wrong units would be a problem then.
Implemented via #29.
Dataset can now read the energies and forces from an extxyz file. Units will be converted when a units specified when writing to a fille.