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

(Request) Support for molecular XYZs without Lattice key #16

Closed
joegilkes opened this issue Apr 20, 2022 · 6 comments
Closed

(Request) Support for molecular XYZs without Lattice key #16

joegilkes opened this issue Apr 20, 2022 · 6 comments

Comments

@joegilkes
Copy link
Contributor

Hi James,

I was just wondering if there would be any interest in making this compatible with extXYZ files that don't include a Lattice key, i.e. for molecular geometries with no inherent unit cell?

I'd really like to use this as a simple, lightweight library for doing some low-level manipulation of molecular xyz files within Julia, but unfortunately the hard requirement for a unit cell to be provided means this package won't work on those files.

Thanks!

@jameskermode
Copy link
Member

jameskermode commented Apr 20, 2022

Good question. I'm not adverse to supporting molecular geometries, just have never needed to. There is already an optional pbc key that you can use to signify open boundary conditions, so it would make sense to allow Lattice to be left out in those cases.

I'm not sure if this can be done only by making changes in this package, but I'm open to a PR which tries to do that if you'd be willing to try it out. It may be that we'd need to change the specification/implementation of the underlying C parser, but that's also possible.

Also, you will see in #15 that I'm planning to add an interface to https://github.com/JuliaMolSim/AtomsBase.jl in some form in the near future. I'm not sure how that deals with open boundary conditions either at this point.

@cortner
Copy link
Member

cortner commented Apr 20, 2022

Is it a problem to just provide a trivial cell, or to just ignore the cell with no PBC? Or is the issue that you want to use existing datasets that come without the cell?

@gabor1
Copy link

gabor1 commented Apr 20, 2022

I would support this enhancement because it would mean that some old XYZ files could also be read (ones with empty second lines. It's not complete backwards compatibility because we still require the second line to be a sequence of =

@joegilkes
Copy link
Contributor Author

That's mostly the issue yes, I'm working within a workflow that writes extXYZs from one program and I want to read/manipulate/write them within Julia. It would definitely be possible to prepend/remove the Lattice key as necessary, it would just feel a bit clunky to have to do so.

I'm up for looking into the code and seeing if I can get it working solely within the package. For the most part it appears like it would be simple, but I'm not familiar with the C backend so I can't predict how the call to extxyz_write_ll would be handled in the event that there wasn't a Lattice key in the info dict. I'll take a look tomorrow and report back.

@joegilkes
Copy link
Contributor Author

Appears to be a simple fix, opened PR #17.

@jameskermode
Copy link
Member

v0.1.5 tagged and released

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

No branches or pull requests

4 participants