-
Notifications
You must be signed in to change notification settings - Fork 6
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
added Units for AtomsBase interface + a Base.show routine #19
Conversation
Thanks, this is nice. I agree it would be good to add unit conversion for velocities and masses. ExtXYZ spec doesn’t impose a choice of time units, but let’s follow the ASE units system: https://wiki.fysik.dtu.dk/ase/ase/units.html which means lengths are in A, energies in eV and masses are in amu and time thus has somewhat strange units. |
Regarding the atomic_masses property, I agree with removing them from the dict to skip writing but only if they were automatically created from chemical species. If the input file had a custom mass property this should be persevered in a read / write / read round trip. Not sure how best to implement that. |
Please could you also add a test of the unit conversion functionally? |
atomic_masses: unit test: |
Both solutions sound good including the extra test of unit conversion, please go ahead. |
…es are written in file if differ to matching masses of number/symbol
…ed a third save routing with systems::Vector{Atoms}
…omsBase interface
atomic_masses: unit test: What are your thoughts on this? |
I think also converting units for the ASE default property names of |
…s are read with a unit
Okay, now i have added those units, hopefully i don't miss any unit? For velocities I have added that they also get a unit by reading, but are not set on zero by default, as you wished. I have added the Base.show routine with the name "Atoms" for the system. There i am not sure how to create a test for this, any ideas? The data routine I have skipped for the moment, I think i understood something wrong about the data field in AtomsBase. I will think about how to do this the best. In AtomsBase there is no way to get all this information, saved in the data block of FlexibleSystem or Atom, yet, but i think it would be nice to add this in both, AtomsBase and here. What are your thoughts on this? Happy about any feedback or further ideas. |
Could the string representation could be evaluated as Julia code and then checked for equality with the original struct? Happy to leave off the |
Okay I have added a test for the show representation. |
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.
Looking good generally, just a couple of minor comments
Thanks for all the hard work. I'll go ahead and merge and then tag a new release. We can pick up any further things in new PR(s). |
Cool, thanks a lot. |
@JanHab v0.1.7 has been released via General registry |
Hello - I added Units for the box and positions.
In AtomsBase the user can use any length unit and is not forced to use Ängstrom. Therefore I added a _write_convert routine specified for Length units which converts the units in Ängstrom and then uses ustrip. to cut the unit.
I would like to add this for units like mass and velocity, if this is wished by you, but could not find the units ExtXYZ uses in this cases. At the moment these units are just cutted of.
Additionally I added that the atomic_masses are looked up in the Atoms function and are deleted from atom_data in the write_dict function so that they are not written in the final file.
Is this wished or should they be written down in the file as well?