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

Bugfix nasa as dict #1630

Merged
merged 2 commits into from
Jun 25, 2019
Merged

Bugfix nasa as dict #1630

merged 2 commits into from
Jun 25, 2019

Conversation

goldmanm
Copy link
Contributor

Motivation or Problem

NASA polynomials would throw an error when calling the as_dict method when optional variables like Tmin are not set.

Description of Changes

Added an if statement to the as_dict method to only add attributes which are set.

Testing

RMG tests should be sufficient

@goldmanm goldmanm requested a review from alongd June 17, 2019 15:53
@alongd
Copy link
Member

alongd commented Jun 17, 2019

Looking good! Would you like to remove Tmin / Tmax from one of the tests?

@codecov
Copy link

codecov bot commented Jun 17, 2019

Codecov Report

Merging #1630 into master will increase coverage by 0.43%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1630      +/-   ##
=========================================
+ Coverage   41.37%   41.8%   +0.43%     
=========================================
  Files         177     177              
  Lines       29455   29455              
  Branches     6059    6059              
=========================================
+ Hits        12186   12314     +128     
+ Misses      16417   16271     -146     
- Partials      852     870      +18
Impacted Files Coverage Δ
rmgpy/data/kinetics/family.py 52.67% <0%> (-0.24%) ⬇️
rmgpy/data/statmech.py 43.23% <0%> (+15.51%) ⬆️
rmgpy/data/statmechfit.py 46.33% <0%> (+33.2%) ⬆️

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 93fac25...18a916f. Read the comment docs.

@amarkpayne
Copy link
Member

I am currently working on the yaml file standardization for the isodesmic reaction code, so this PR is very relevant to me. I have looked over the code, and it looks good to me. I like @alongd 's suggestion about adding a test for ensuring that an error is not thrown when Tmin/Tmax is not set, but I don't want this to hold up the PR from being merged. If you have the unit test for this already go ahead and add it. Otherwise, I believe this test will come up naturally in my isodesmic PR (or if not I'll add in a test). Either way @goldmanm feel free to update this branch and merge.

amarkpayne
amarkpayne previously approved these changes Jun 25, 2019
Previously, NASA.as_dict would throw an error if attributes like
Tmin, Tmax, E0 were unset. These variables, however, are optional,
so Arkane should not crash if they are unset.

This commit fixes the as_dict method to not throw an error
for optional attributes
This commit adds two test methods for NASA.as_dict and
two tests to load species from nasa polynomials in Arkane.

squash! Add tests to load species from NASA polynomials
@goldmanm
Copy link
Contributor Author

Added two tests ensuring that as_dict saves set attributes and does not save unset attributes.

@alongd
Copy link
Member

alongd commented Jun 25, 2019

Looking good!

@amarkpayne amarkpayne merged commit 4fab586 into master Jun 25, 2019
@amarkpayne amarkpayne deleted the bugfix_nasa_as_dict branch June 25, 2019 18:50
@mliu49 mliu49 mentioned this pull request Jul 23, 2019
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.

3 participants