-
Notifications
You must be signed in to change notification settings - Fork 5
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
ASE: Use guess=true
while checking parser support
#29
Conversation
Thanks for the suggestion. Hmm I guess that was to be careful and to avoid issues when file extensions are not unique. For sure we should make this a parameter exposed to the user (eg a flag in ASEParser, but before changing it we should double check this has no negative side effects. We could also have two ase parser objects in the default list of parsers: the first more strict and the second laxer. This would make it more obvious what's the cause in case sth. breaks in the future. |
Oh also please provide example files for edge cases / unexpected behaviour if you can. Always good to add them to the atomsio test suite, because the whole parsing stuff is indeed quite messy. |
Sorry for the late reply. I was a little busy and could not respond to you comments. I think defining these parameters in the
Additionally, it seems that currently the
This behavior is present for "*.vasp" files also. There are individual functions AtomsIO.jl/lib/AtomsIOPython/src/ase.jl Lines 32 to 34 in f15cec6
would need to changed to
If these changes seem fine, I will modify the PR accordingly. Let me know what you think. |
Sounds good. I'm a bit confused what the |
- Add arguments to `filetype` function in `AseParser` struct with default same as ASE. - Check whether ASE can read or write format was not done. Add these checks using `can_read` and `can_write` functios of `ioformat`.
5f0739c
to
701c500
Compare
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.
Thanks getting close. Just a small refactor ;)
I have implemented your suggestions. And have removed the I have also added a test for xsf format which would not pass in the current master. Let me know if these changes are okay. |
@rashidrafeek Could you add tests in |
Sorry for the delay here. I have added .xyz and .vasp to the tests, which I use regularly. Also, there was a mistake in the wording of the warning. The bug occurs when trying to read, not write (i.e, save=false). Hope it is good to go now. |
Thanks! |
Is there a reason for setting
guess=false
while checking parser support? Only ifguess=true
will ASE guess the extension based on extension and therefore can read many formats like VASP POSCARS (*.vasp, POSCAR*), QE input (*.in) etc. Currently, it shows an error:Python: UnknownFileTypeError: Could not guess file type
due to settingguess=false
.