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

Revamped training reaction ipython notebook #1373

Merged
merged 3 commits into from
May 29, 2018
Merged

Conversation

mliu49
Copy link
Contributor

@mliu49 mliu49 commented May 22, 2018

This PR moves the convertKineticsLibraryToTrainingReactions.ipynb notebook from RMG-database to RMG-Py. This was done to make it easier to keep the script up to date with RMG-Py.

The notebook was streamlined substantially by converting most of the code to functions and moving them into a separate file. New steps were also added to handle the common issue of having multiple matches and offer summary to review the reactions to be added.

Some improvements were also added to KineticsFamily.saveTrainingReactions to make it easier to use.

This PR includes changes from ReactionMechanismGenerator/RMG-database#125 and ReactionMechanismGenerator/RMG-database#241.

@codecov
Copy link

codecov bot commented May 22, 2018

Codecov Report

Merging #1373 into master will increase coverage by 0.01%.
The diff coverage is 3.12%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1373      +/-   ##
==========================================
+ Coverage   42.17%   42.18%   +0.01%     
==========================================
  Files         172      172              
  Lines       28000    28005       +5     
  Branches     5500     5505       +5     
==========================================
+ Hits        11809    11814       +5     
- Misses      15398    15399       +1     
+ Partials      793      792       -1
Impacted Files Coverage Δ
rmgpy/data/kinetics/family.py 59.82% <3.12%> (+0.16%) ⬆️

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 04af89d...ffe80af. Read the comment docs.

@mliu49 mliu49 requested a review from amarkpayne May 22, 2018 19:32
@mliu49 mliu49 added the Status: Ready for Review PR is complete and ready to be reviewed label May 22, 2018
@mjohnson541
Copy link
Contributor

If you aren't aware you only merged in the first commit from #1370

@mliu49
Copy link
Contributor Author

mliu49 commented May 22, 2018

I changed the default value for reference back to None and dropped the second commit. Was there a reason you had changed it to an empty string?

@mjohnson541
Copy link
Contributor

Ok, I honestly don't really remember, but I'll find out if I have to run the rules to training reactions script again.

@amarkpayne amarkpayne self-assigned this May 23, 2018
Copy link
Member

@amarkpayne amarkpayne left a comment

Choose a reason for hiding this comment

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

So far everything looks good, though I am still looking over this middle commit--I'll have more for you soon.

for rxn in reactions:
for spec in (rxn.reactants + rxn.products):
for ex_spec_label in speciesDict:
ex_spec = speciesDict[ex_spec_label]
for ex_spec in species_dict.itervalues():
Copy link
Member

Choose a reason for hiding this comment

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

Good catch!

@@ -0,0 +1,425 @@
#!/usr/bin/env python
Copy link
Member

Choose a reason for hiding this comment

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

Since this file does not have a main() function that would get executed if you were to run this as a script, should we move this file to rmgpy/tools/ where code related to this is stored?

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 considered that, but also wanted to keep it close to the ipython notebook. I can move it if you think it would be better.

Copy link
Member

Choose a reason for hiding this comment

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

I am fine with it here then

@amarkpayne amarkpayne self-requested a review May 23, 2018 23:32
amarkpayne
amarkpayne previously approved these changes May 25, 2018
Copy link
Member

@amarkpayne amarkpayne left a comment

Choose a reason for hiding this comment

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

The ipynb works just fine for me, and the code looks good. This is an awesome ipython notebook!

Update the branch and I'l merge this in.

@@ -0,0 +1,425 @@
#!/usr/bin/env python
Copy link
Member

Choose a reason for hiding this comment

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

I am fine with it here then

mliu49 and others added 3 commits May 25, 2018 22:21
Add new reactions to currently loaded depository for immediate use
Remove excess line breaks when saving entries
Update variable names and general formatting
Updated version of the convertKineticsLibraryToTrainingReactions
notebook in RMG-database. Transferring it to RMG-Py to make it
easier to keep up to date with RMG-Py.

Most of the code in the notebook has been moved to a separate
file to make the notebook more compact and user-friendly.
@mliu49
Copy link
Contributor Author

mliu49 commented May 29, 2018

@amarkpayne, this has been rebased and is ready to merge.

@amarkpayne amarkpayne merged commit 7848ac7 into master May 29, 2018
@amarkpayne amarkpayne deleted the save_training branch May 29, 2018 22:53
@amarkpayne amarkpayne removed the Status: Ready for Review PR is complete and ready to be reviewed label May 29, 2018
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