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

Add optimal_geometry method #11

Merged
merged 4 commits into from
Mar 10, 2022
Merged

Conversation

sofroniewn
Copy link
Contributor

This PR closes #10 by adding an optimal_geometry method to the properties API. It also adds a make_copy method to the Mol and Sol systems. It adds basic tests to cover the make_copy and optimal_geometry.

Overall I tried to match the code, naming, and commenting style of the repo as best I could - feel free to change or request changes on anything you don't like.

One thing I am wondering is if you still like the optimal_geometry name and function descriptions. Alternatives could emphasize that it is a position that is a local minimum of the energy. I don't really mind.

Copy link
Collaborator

@mfkasim1 mfkasim1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR! I have several comments, mostly minor and should be easily addressed. Overall, it looks good!

dqc/api/properties.py Outdated Show resolved Hide resolved
dqc/api/properties.py Outdated Show resolved Hide resolved
dqc/api/properties.py Show resolved Hide resolved
dqc/system/mol.py Show resolved Hide resolved
dqc/system/mol.py Outdated Show resolved Hide resolved
dqc/system/sol.py Outdated Show resolved Hide resolved
dqc/test/test_properties.py Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Mar 7, 2022

Codecov Report

Merging #11 (a678f31) into master (864fbe4) will increase coverage by 0.08%.
The diff coverage is 96.72%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #11      +/-   ##
==========================================
+ Coverage   92.00%   92.09%   +0.08%     
==========================================
  Files          72       72              
  Lines        7505     7564      +59     
==========================================
+ Hits         6905     6966      +61     
+ Misses        600      598       -2     
Flag Coverage Δ
unittests 92.09% <96.72%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
dqc/system/base_system.py 71.66% <50.00%> (-0.27%) ⬇️
dqc/api/properties.py 98.94% <100.00%> (+0.09%) ⬆️
dqc/system/mol.py 85.85% <100.00%> (+0.36%) ⬆️
dqc/system/sol.py 93.12% <100.00%> (+2.00%) ⬆️
dqc/test/test_properties.py 100.00% <100.00%> (ø)
dqc/test/test_system.py 98.85% <100.00%> (+0.12%) ⬆️
dqc/utils/datastruct.py 96.42% <0.00%> (+1.19%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 864fbe4...a678f31. Read the comment docs.

@sofroniewn
Copy link
Contributor Author

I have pushed what I think are all the requested changes - please let me know if you have any more or if there is anything else you'd like to see changed before merge.

Copy link
Collaborator

@mfkasim1 mfkasim1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes. I have several minor comments on the changes like before.
Another thing is the mypy test fails (you can see the red cross next to typestyle test). Can you fix this in this PR? If not, I can fix it after this being merged.
To test it locally, you can just execute in terminal mypy in the same directory as the file mypy.ini.

dqc/api/properties.py Outdated Show resolved Hide resolved
dqc/system/mol.py Outdated Show resolved Hide resolved

Arguments
---------
kwargs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use **kwargs here instead of kwargs to differentiate between method(kwargs) and method(**kwargs)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

dqc/system/mol.py Show resolved Hide resolved
dqc/system/sol.py Outdated Show resolved Hide resolved
@sofroniewn
Copy link
Contributor Author

Thanks for the changes. I have several minor comments on the changes like before.

I have now fixed all of those, please let me know if there is anything else or if you want things fixed in a different way.

Another thing is the mypy test fails (you can see the red cross next to typestyle test). Can you fix this in this PR? If not, I can fix it after this being merged.
To test it locally, you can just execute in terminal mypy in the same directory as the file mypy.ini.

I think it might be best if you fix the mypy errors if you can. I'm not so familiar with mypy and the best way to fix them. It looks like there are three

  • one around Too many arguments for "BaseQCCalc", which looks like it can be solved by adding an init method to the class (see stackoverflow) but it might be easier if you do that if you like that solution
  • two around passing a dict to Mol and Sol respectively. It wasn't clear to me how to do that.

I have allowed edits from maintainers so feel free to directly push to this PR too

@mfkasim1
Copy link
Collaborator

Great, thanks for the PR! It looks good to me, so I will merge it once the ci tests are passed. I can do the mypy correction later.

@mfkasim1 mfkasim1 merged commit 0fe821f into diffqc:master Mar 10, 2022
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.

[ENH] Geometry optimization
3 participants