Skip to content
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

Properly integrate XSF #23

Closed
wants to merge 2 commits into from
Closed

Properly integrate XSF #23

wants to merge 2 commits into from

Conversation

mfherbst
Copy link
Owner

Turns out we missed to actually test in the previous PR. This does some cleanup and enables tests ... which actually fail. @azadoks could you take a look?

There are also a few other things, which are strange. E.g. I think it is a bad idea that load_xsf strips off the vector list in case there is only one structure. Because than we need to do wonky stuff in load_trajectory to put the vector back on (The load_trajectory requires that a vector is returned).

@azadoks
Copy link
Contributor

azadoks commented Jul 20, 2023

Yeah, I did flip-flop a bit on returning a vector with one element or not. In the end, I didn't just so that write(read(io)) wouldn't turn a single-structure file into an animated one, but I can check for that in write rather than dealing with it in the return of read.

I'll take a look and submit a patch.

@azadoks
Copy link
Contributor

azadoks commented Jul 20, 2023

First issue that I've found is that the test systems define arbitrary atomic masses, and all I get from the XSF is the atomic symbol, so I set the atomic mass to be that from the periodic table.

Not even creating my own atom / system implementations will fix this; either the tests will fail because no atomic_mass is implemented, or they'll fail because it's the wrong value.

Second issue is velocity, which I can't force to be anything but zero in the AtomsBase.Atom because it's baked into the type. I can't get around this with FastSystem because it doesn't support extra data (forces).

I guess I'll need to implement my own system, at minimum, and possibly my own atom; this is a bit frustrating because it's exactly what I didn't want to do.

@mfherbst
Copy link
Owner Author

No you don't. I'm lacking the time to look at the details, but you can just disable in the test system that custom masses are specified in the system construction. (see the chemfiles test which uses the dropkeys)

In the end it is only expected that AtomsBase structures return some mass, but it is not required that this mass can be modified. Same for velocities. If zero velocities or just missing is returned, that's fine.

@mfherbst mfherbst mentioned this pull request Aug 14, 2023
@mfherbst
Copy link
Owner Author

Superseeded by #25.

@mfherbst mfherbst closed this Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants