stfc / janus

collection of scripts to train and generate data for machine learnt interatomic potentials
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Cannot define units for extxyz #65

Open ElliottKasoar opened 1 year ago

ElliottKasoar commented 1 year ago

Currently, Dataset.write_extxyz_file will always write in units of eV/Ang when called via Dataset.write .

Although in reality these may always be the desired units, it is inconsistent with all other formats, which default to eV/Ang (apart from n2p2), but can be written with other units if explicitly passed. Units passed in the case of extxyz files will be ignored, which may cause confusion.

The simplest solution would be to remove self.change_units_all(units), and therefore also the units parameter for Dataset.write_extxyz_file, allowing all unit conversions to be handled by the main Dataset.write function, as is already the case for n2p2 and all other formats.

alinelena commented 1 year ago

this is brilliant catch.. I was looking exactly today at converting some data to extxyz and I noticed the issue. the problem is more confusing since in theory n2p2 uses runner convention of units but in reality one can pass to input.data to n2p2 whatever consistent units one likes.