-
Notifications
You must be signed in to change notification settings - Fork 860
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
IO support for res files (AIRSS results) #2625
Conversation
- blank lines - END tag - empty tags
for more information, see https://pre-commit.ci
- typing names for py38 - pydoc for the things pydocstyle complained about
- Removed exposure of the Res dataclass. - Added providers that expose features of the res file in a clean way. - Moved all the private module level functions with bad names to appropriate classes for their use. - Added a writer class that encapsulates all those private module level functions that supported writing.
Thanks for working on this @ScottNotFound, it'll be a nice addition. It looks like the PR is basically complete, are you waiting on anything besides linting? I'm not sure if the capitalized Being unfamiliar with both the AIRSS file format and shelx, I will trust this is appropriate :) Are there any AIRSS input parameters that might substantially change the output format; are there any additional test example files that should be added? |
Ah, I see a test failure too:
I know this is marked as a WIP, so assume this is already known! |
The implementation is pretty much done. I was going to add some more tests for the module. After those I'll mark it ready for review. PEP8 says something to the effect of constants being all caps, but I just named them the way the tags appear in the res file. They are frozen dataclasses.. not sure if that counts as constant. Those are all internal though so they can be changed if you prefer a different style. I actually don't know anything about the shelx file format other than it exists. I considered supporting it, but it was hard to find information on it. Also not sure if anyone other that AIRSS still uses it. As for AIRSS parameters changing the format, I'm not sure. I've only used CASTEP with AIRSS. I've assumed some things are common to all AIRSS runs, but it's possible that may not be the case. I be surprised if the parts that matter (like the structure and TITL entry) were different. |
Yeah I found that while writing a test after refactoring. VSCode is not as good as pycharm at refactoring method names. |
for more information, see https://pre-commit.ci
Looks like the linter failed because mypy doesn't have type info for dateutil. I installed the type stubs into my env, but the linter env doesn't have them. I guess I can either:
|
Very nice PR! Thanks @ScottNotFound. |
Thanks both for lending AIRSS expertise :) Not relevant to this PR, but I did want to point out we have new-ish I also have my own stalled CASTEP PR @ #2048 which is actually almost ready to merge, but I wanted to update to use these base classes myself. |
Looks like Not sure why |
Thanks @ScottNotFound, I have no concerns about this PR -- I'll go ahead and merge, thanks again. The unrelated failures I can look into separately. |
Summary
Include a summary of major changes in bullet points:
Additional dependencies introduced (if any)
TODO (if any)
If this is a work-in-progress, write something about what else needs
to be done
Checklist
Work-in-progress pull requests are encouraged, but please put [WIP]
in the pull request title.
Before a pull request can be merged, the following items must be checked:
is to run the following in the correct sequence on your local machine. Start with running
black on your new code. This will automatically reformat
your code to PEP8 conventions and removes most issues. Then run
pycodestyle, followed by
flake8.
Run pydocstyle on your code.
Note that the CI system will run all the above checks. But it will be much more efficient if you already fix most
errors prior to submitting the PR. It is highly recommended that you use the pre-commit hook provided in the pymatgen
repository. Simply
cp pre-commit .git/hooks
and a check will be run prior to allowing commits.