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

Allow relative paths in Arkane statmech #1685

Merged
merged 3 commits into from
Sep 26, 2019
Merged

Allow relative paths in Arkane statmech #1685

merged 3 commits into from
Sep 26, 2019

Conversation

alongd
Copy link
Member

@alongd alongd commented Aug 12, 2019

Motivation or Problem

Previously Arkane joined the base path of the species file with any statmech file (ESS output) path, assuming that the paths to the statmech files are relative to the species file directory.

In StatMechJob.load(), path is the path to the Arkane specie file, and directory is the base path of path. When we read an ESS log file we join directory and its path, e.g.: os.path.join(directory, energy.path). However, if energy.path is a relative path (of the single point calculation output file), Arkane won't be able find the latter due to this path manipulation.

Description of Changes

All statmech files specified by users (energy, geometry, frequency, scans) are now first checked to see if they exist, if not we relate to them as relative to directory (and if that doesn't work, we raise an error).

Testing

Added a test for absolute paths (fails on master)

Reviewer Tips

See that the code makes sense, try specifying an absolute path in a species statmech file and run on this branch (should fail on master)

(edited)

@alongd alongd requested a review from goldmanm August 12, 2019 15:59
@alongd alongd self-assigned this Aug 12, 2019
@alongd alongd force-pushed the arkane_absolute branch 2 times, most recently from 6903ac0 to b9de5ca Compare August 12, 2019 16:43
@codecov
Copy link

codecov bot commented Aug 12, 2019

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1685   +/-   ##
=======================================
  Coverage   41.66%   41.66%           
=======================================
  Files         176      176           
  Lines       30215    30215           
  Branches     6256     6256           
=======================================
  Hits        12588    12588           
  Misses      16703    16703           
  Partials      924      924

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 3846fcc...b9de5ca. Read the comment docs.

@codecov
Copy link

codecov bot commented Aug 12, 2019

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1685   +/-   ##
=======================================
  Coverage   32.65%   32.65%           
=======================================
  Files          87       87           
  Lines       26158    26158           
  Branches     6874     6874           
=======================================
  Hits         8541     8541           
+ Misses      16656    16645   -11     
- Partials      961      972   +11
Impacted Files Coverage Δ
rmgpy/data/statmech.py 42.39% <0%> (ø) ⬆️
rmgpy/rmg/pdep.py 12.21% <0%> (ø) ⬆️
rmgpy/reaction.py 0% <0%> (ø) ⬆️
rmgpy/data/kinetics/family.py 48.49% <0%> (ø) ⬆️
rmgpy/yml.py 15.71% <0%> (ø) ⬆️
rmgpy/data/kinetics/database.py 50.73% <0%> (ø) ⬆️
rmgpy/rmg/input.py 34.34% <0%> (ø) ⬆️
rmgpy/molecule/molecule.py 0% <0%> (ø) ⬆️
rmgpy/statmech/ndTorsions.py 59.89% <0%> (ø) ⬆️

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 77cdd46...5f32f40. Read the comment docs.

@alongd alongd changed the title Allow absolute paths in Arkane statmech Allow relative paths in Arkane statmech Aug 12, 2019
@alongd
Copy link
Member Author

alongd commented Sep 25, 2019

@goldmanm, this PR should be relatively easy. Do you mind taking a look? (rebased on the Py3 master)

@goldmanm
Copy link
Contributor

goldmanm commented Sep 26, 2019 via email

@goldmanm goldmanm merged commit 581ca34 into master Sep 26, 2019
@amarkpayne amarkpayne deleted the arkane_absolute branch September 26, 2019 16:23
@mliu49 mliu49 mentioned this pull request Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants