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

Auto optical isomer ex symmetry arkane #1571

Merged
merged 6 commits into from Apr 25, 2019

Conversation

goldmanm
Copy link
Contributor

@goldmanm goldmanm commented Apr 3, 2019

Motivation or Problem

Currently Arkane requires optical isomer input.

Description of Changes

This PR allows Arkane to estimate optical isomer and symmetry using the qm symmetry package.

Testing

  • I wrote test methods to ensure that the arkane
  • I have not tested compatibility with ARC, which may cause an issue since the redundant symfromlog boolean was removed.

Reviewer Tips

Run an arkane calculation with & without the symmetry and optical isomer parameter.

@codecov
Copy link

codecov bot commented Apr 3, 2019

Codecov Report

Merging #1571 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1571   +/-   ##
=======================================
  Coverage   41.67%   41.67%           
=======================================
  Files         166      166           
  Lines       28452    28452           
  Branches     5855     5855           
=======================================
  Hits        11858    11858           
  Misses      15773    15773           
  Partials      821      821

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 88e62a8...009a23c. Read the comment docs.

@goldmanm goldmanm force-pushed the auto_optical_isomer_ex_symmetry_arkane branch from 614b97b to 4f1c8c6 Compare April 4, 2019 20:10
@alongd alongd self-requested a review April 8, 2019 13:20
@alongd alongd added the Arkane label Apr 8, 2019
@alongd
Copy link
Member

alongd commented Apr 8, 2019

@goldmanm, many of Arkane's tests still use the symfromlog argument, could you resolve it so the tests will pass?

@goldmanm goldmanm force-pushed the auto_optical_isomer_ex_symmetry_arkane branch from 4f1c8c6 to 39ced9d Compare April 8, 2019 14:17
@goldmanm
Copy link
Contributor Author

goldmanm commented Apr 8, 2019

@alongd, fixes for the tests should be back up. I was trying to fix a codacy issue and ended up pushing outdated version of the branch. force pushing is dangerous.

Copy link
Member

@alongd alongd 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 this contribution!!
Please see some comments, most are minor

arkane/gaussian.py Outdated Show resolved Hide resolved
arkane/log.py Outdated Show resolved Hide resolved
arkane/log.py Outdated Show resolved Hide resolved
arkane/statmech.py Outdated Show resolved Hide resolved
arkane/statmech.py Show resolved Hide resolved
arkane/log.py Outdated
symmetry = pg.symmetryNumber
logging.debug("Symmetry algorithm found {0} optical isomers and a symmetry number of {1}".format(optical_isomers,symmetry))
else:
logging.warning("Symmetry algorithm errored when computing optical isomers. Setting to 1")
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be a logging.error level, and the text should tell the user to try re-running and supply the missing values (unless we want to raise an error?)
Also, the current message only refers to opt isomers, symmetry could be problematic as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wonder how making this an error might cause issues when integrating with ARC (or other automated software generation). I guess we just have to integrate the code in a way such that a factor of two error does not destroy the whole RMG run.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to logging.error

arkane/log.py Show resolved Hide resolved
arkane/statmech.py Outdated Show resolved Hide resolved
arkane/molpro.py Outdated Show resolved Hide resolved
arkane/gaussianTest.py Show resolved Hide resolved
@goldmanm goldmanm force-pushed the auto_optical_isomer_ex_symmetry_arkane branch 2 times, most recently from fb42dd4 to f1e196f Compare April 10, 2019 19:12
@goldmanm goldmanm force-pushed the auto_optical_isomer_ex_symmetry_arkane branch from f1e196f to b4c49df Compare April 17, 2019 18:49
@alongd
Copy link
Member

alongd commented Apr 24, 2019

@goldmanm, let's rebase and merge this PR, then do the respective ARC PR

This commit makes the Log file readers for QChem, Gaussian and
Molepro inherit from the base Log class, which can reduce code
duplication going forward.

To do this, the method `determine_qm_software` was removed from
the Log class as this causes circular import errors, and the
`Log` class was moved to a separate file, in accordance with PEP-8.

Methods used in all child classes are added to the parent Log
class.

This commit also modified methods calling `determine_qm_software`,
and references to `isinstance(x,Log)` were altered to not include
the children log files.
Previously, not having the number of opticalIsomers would throw
and error. Now the computer can estimate the number of optical
isomers, so no input is accepted.
Prevously loadConformer required an integer input for optical isomers.
This commit allows this method to call the Symmetry package and estimate
the value automatically.
Created new method get_optical_isomers_and_symmetry_number in Log class
This method allows Log objects to calculate the number of optical
isomers and symmetry numbers contained within a log file.
This was taken and modified from the equivalent method in ARC (credits to Alon).

Remove symfromlog parameter. If using the RMG QM symmetry package,
the symfromlog parameter is not necessary and confusing.
This commit removes the need for such a parameter.

Get Arkane to use Symmetry package for symmetry.
This commit uses the Symmetry package to estimate symmetry if not
explicitly given by the user by modifying the gaussian, molpro,
and qchem parsers.
Previously, no error was raised when the `linear` parameter was not
implemented properly. This could hide information about incorrect
calculations if the user is not properly implementing the parameter.

This commit raises an error if no `linear` parameter is given.
@goldmanm goldmanm force-pushed the auto_optical_isomer_ex_symmetry_arkane branch from b4c49df to 009a23c Compare April 24, 2019 22:27
@alongd alongd merged commit 4b1c083 into master Apr 25, 2019
@alongd alongd deleted the auto_optical_isomer_ex_symmetry_arkane branch April 25, 2019 14:52
@mliu49 mliu49 mentioned this pull request May 15, 2019
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants