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

Fix kinetics fitting with Tmin & Tmax in Arakne #1672

Merged
merged 1 commit into from Aug 1, 2019

Conversation

goldmanm
Copy link
Contributor

Motivation or Problem

Previously, there were two spots where a list of temperatures
was created for fitting high pressure kinetics in Arkane.
One fit using inverse temperature spacing and the other one fit
with linear temperature spacing. See #1671

Description of Changes

This PR consolidates creating a listing of temperatures
to the init method, so there is only one spot where temperatures
are initialized. The default min and max in generateKinetics was
moved into the init method. Three unittests were written for
obtaining the proper temperatures in the init method.

generateKinetics previously accepted an arguement Tlist, which
is already an attribute of KineticsJob, creating redundancy.
The Tlist argument was removed and self.Tlist was used
in this method instead, simplifying the code.

Calls to quantity.Quantity in the init method were unnecessary
before setting them with quantity.Temperature, so the init
code was simplified by setting attributes with (value, 'K') instead.

Documentation was updated to better describe the three methods
of specifying temperatures when calling kinetics in Arkane

Testing

did make test and ran the kinetics examples in RMG. also did make html to check for errors in the documentation.

Reviewer Tips

Read over code to make sure it makes sense.

@codecov
Copy link

codecov bot commented Jul 28, 2019

Codecov Report

Merging #1672 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1672      +/-   ##
==========================================
- Coverage   41.88%   41.86%   -0.02%     
==========================================
  Files         176      176              
  Lines       29368    29368              
  Branches     6059     6059              
==========================================
- Hits        12301    12296       -5     
- Misses      16188    16192       +4     
- Partials      879      880       +1
Impacted Files Coverage Δ
rmgpy/data/kinetics/family.py 52.67% <0%> (-0.24%) ⬇️

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 1369f9e...a5f77f5. Read the comment docs.

@codecov
Copy link

codecov bot commented Jul 28, 2019

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1672      +/-   ##
==========================================
+ Coverage   41.87%   41.88%   +0.01%     
==========================================
  Files         176      176              
  Lines       29369    29369              
  Branches     6059     6059              
==========================================
+ Hits        12297    12302       +5     
+ Misses      16192    16188       -4     
+ Partials      880      879       -1
Impacted Files Coverage Δ
rmgpy/data/kinetics/family.py 52.9% <0%> (+0.23%) ⬆️

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 69122e6...46ae3d7. Read the comment docs.

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! Please see some comments

else:
self.Tmin = None
self.Tmin = (298, 'K')
Copy link
Member

Choose a reason for hiding this comment

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

Could you simplify these assignments into:
self.Tmin = Tmin if Tmin is not None else (298, 'K')?
Same for Tmax?

We could also simplify Tcount:
self.Tcount = Tcount if Tcount > 3. else 50

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. I just added that.

arkane/kinetics.py Show resolved Hide resolved
arkane/kinetics.py Show resolved Hide resolved
arkane/kineticsTest.py Outdated Show resolved Hide resolved
arkane/kineticsTest.py Show resolved Hide resolved
documentation/source/users/arkane/input.rst Outdated Show resolved Hide resolved
documentation/source/users/arkane/input.rst Show resolved Hide resolved
Previously, there were two spots where a list of temperatures
was created for fitting high pressure kinetics in Arkane.
One fit using inverse temperature spacing and the other one fit
with linear temperature spacing. See #1671

This commit moves the location for creating a listing of temperatures
to the __init__ method, so there is only one spot where temperatures
are initialized. The default min and max in `generateKinetics` was
moved into the __init__ method. Three unittests were written for
obtaining the proper temperatures in the __init__ method.

`generateKinetics` previously accepted an arguement Tlist, which
is already an attribute of KineticsJob, creating redundancy.
The Tlist argument was removed and self.Tlist was used
in this method instead, simplifying the code.

Calls to quantity.Quantity in the __init__ method were unnecessary
before setting them with quantity.Temperature, so the __init__
code was simplified by setting attributes with (value, 'K') instead.

Documentation was updated to better describe the three methods
of specifying temperature when calling `kinetics` in Arkane
@goldmanm goldmanm mentioned this pull request Jul 30, 2019
7 tasks
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!

@alongd alongd merged commit 589ba9a into master Aug 1, 2019
@alongd alongd deleted the fix_kinetic_fitting_arkane branch August 1, 2019 02:25
@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.

None yet

2 participants