-
Notifications
You must be signed in to change notification settings - Fork 46
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
Input Writer #188
Input Writer #188
Conversation
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.
It seems all clear to me. Great!
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 for the PR! I just have a few minor comments...
|
||
|
||
def write_input(f: TextIO, data: IOData, template: str = None): | ||
"""Do not edit this docstring. It will be overwritten.""" |
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.
Same comment as above regarding documentation decorator.
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.
Only minor comments, but I think the main functionality is complete. Work on the docstring is still pending, so I hope to collaborate on that this week.
iodata/inputs/gaussian.py
Outdated
fields["charge"] = int(data.charge) if data.charge is not None else 0 | ||
|
||
# convert run type to Gaussian keywords | ||
run_types = {"energy": "sp", "freq": "freq", "opt": "opt"} |
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.
Based in #202, we can update this dict to all the run_types supported in IOData.
iodata/inputs/orca.py
Outdated
fields["run_type"] = data.run_type if data.run_type is not None else 'energy' | ||
# convert spin polarization to multiplicity | ||
fields["spinmult"] = int(data.spinpol) + 1 if data.spinpol is not None else 1 | ||
fields["charge"] = int(data.charge) if data.nelec is not None else 0 |
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.
fields["charge"] = int(data.charge) if data.nelec is not None else 0 | |
fields["charge"] = int(data.charge) if data.charge is not None else 0 |
fields["obasis_name"] = data.obasis_name if data.obasis_name is not None else 'STO-3G' | ||
|
||
# convert run type to orca keywords | ||
run_types = {"energy": "Energy", "freq": "Freq", "opt": "Opt"} |
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.
Same as gaussian.py, we can update this dict.
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 for the updates. I've added a few small comments and I also have a few more general small requests:
- Could you add the file header to
iodata/inputs/__init__.py
? - The initialization of the fields dictionary can be moved to a
common.py
module. This code can be reused by most formats.
(There are also some open comments from my previous review. If these are not clear, please let me know. I'll dig them up if needed.)
Codecov Report
@@ Coverage Diff @@
## master #188 +/- ##
==========================================
- Coverage 95.76% 95.56% -0.20%
==========================================
Files 63 65 +2
Lines 6752 6772 +20
Branches 865 860 -5
==========================================
+ Hits 6466 6472 +6
- Misses 129 139 +10
- Partials 157 161 +4
Continue to review full report at Codecov.
|
(No need to worry about the code coverage failures. These reports are not always accurate but it does add useful comments in the code at times.) |
@tovrstra @FarnazH can we get this moving? Several people in the group (@BradenDKelly @wilhadams @fwmeng88 Menna, @tczorro) all need this moving forward and are creating their own tools and duplicating work in its absence. |
This is going to be a lovely feature! I like it as I hide my ugly scripts in a safe place. Edit: One short question: do we need to use basis_set_exchange to support a non-standard Gaussian basis set or the |
I was looking into this a few days ago and wanted to go through it in short term, so yep. I'm picking this up shortly. Also other PRs need to be looked at. @fwmeng88 I'll come back to your question after having gone through the diff. |
@fwmeng88 You are right any non-standard basis sets would have to be put in the template. This may seem easy at first, but there could be a potential difficulty. Gaussian may not run when given custom basis sets for elements not present in the geometry. If you want to run calculations on a database of molecules which vary in chemical composition, the template would need to be modified for each molecule specifically to just include basis functions for the chemical elements that are present. (This is what I remember from long time ago for an older version of Gaussian, so please double check with the latest version.) |
It seems that the free plan of Travis is not exactly working for us. I've tested everything locally and things pass, so I'll merge. Eventually we may have to move away from Travis to get CI up and running again. |
Perhaps we should go to GitHub Actions. |
It's not perfect yet but works nicely. https://github.com/theochem/procrustes/blob/master/.github/workflows/testing.yml |
This PR addresses issue #43.
write_input
is added toapi
module.