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

Debug library to training script #2057

Merged
merged 3 commits into from
Jan 12, 2021
Merged

Conversation

hwpang
Copy link
Contributor

@hwpang hwpang commented Dec 29, 2020

Motivation or Problem

I encountered two errors while converting a library containing this Diels-Alder reaction to training reaction.

(1) Two reactants were wrongly added with the same atom label by add_atom_labels_for_reaction because the two reactants are isomorphic.

(2) The A unit caused problem in add_rules_from_training because only cm mol s units were expected.

Reaction(reactants=[Species(label="ISP", molecule=[Molecule(smiles="C=CC(=C)C")], molecular_weight=(68.117,'amu')), Species(label="ISP", molecule=[Molecule(smiles="C=CC(=C)C")], molecular_weight=(68.117,'amu'))], products=[Species(label="DISP_2", molecule=[Molecule(smiles="C=CC1(C)CCC=C(C)C1")], molecular_weight=(136.234,'amu'))])

Description of Changes

(1) In add_atom_labels_for_reaction, I modified such that the labeled_molecule is removed after it is matched to one of the reactant. This way, two reactants won't be matched to the same atom label.

(2) In kinetics_library_to_training_tools I added an unit conversion for A from arbitrary unit to cm mol s unit.

Testing

After the change, the kinetics_library_to_training.ipynb can process the library without error.

@codecov
Copy link

codecov bot commented Dec 29, 2020

Codecov Report

Merging #2057 (04f618f) into master (43a1ee9) will increase coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2057      +/-   ##
==========================================
+ Coverage   47.54%   47.61%   +0.06%     
==========================================
  Files          88       88              
  Lines       23300    23302       +2     
  Branches     6061     6061              
==========================================
+ Hits        11079    11095      +16     
+ Misses      11062    11052      -10     
+ Partials     1159     1155       -4     
Impacted Files Coverage Δ
rmgpy/data/kinetics/family.py 48.84% <100.00%> (+<0.01%) ⬆️
rmgpy/molecule/draw.py 54.03% <0.00%> (+1.28%) ⬆️

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 43a1ee9...04f618f. Read the comment docs.

mjohnson541
mjohnson541 previously approved these changes Dec 30, 2020
Copy link
Contributor

@mjohnson541 mjohnson541 left a comment

Choose a reason for hiding this comment

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

This looks good to me.

@mjohnson541
Copy link
Contributor

Can you rebase?

@hwpang
Copy link
Contributor Author

hwpang commented Dec 30, 2020

Thanks for the review! It's rebased!

mjohnson541
mjohnson541 previously approved these changes Dec 30, 2020
@hwpang
Copy link
Contributor Author

hwpang commented Dec 30, 2020

I changed '1/s' to 's^-1' for the A unit conversion part to have consistent format with those used in add_rules_from_training.

@hwpang
Copy link
Contributor Author

hwpang commented Dec 30, 2020

I added a line to import ScalarQuantity from rmgpy.quantity for A unit conversion. I had a separate file for my own use and some changes were lost when I copied and pasted. Sorry for the multiple follow up changes, this is the last one!

@hwpang
Copy link
Contributor Author

hwpang commented Jan 12, 2021

I made some minor changes in the jupyter notebook while preparing for RMG workshop.

  • I changed the comment part from 'all' to 'default' because the 'all' option tries to load the Surface families but the relative thermo library is not provided.
  • I changed families to list(database.kinetics.famillies.keys()) to allow using 'default' option.

@mjohnson541 mjohnson541 merged commit 1e21621 into master Jan 12, 2021
@mjohnson541 mjohnson541 deleted the debug_library_to_training branch January 12, 2021 01:36
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.

2 participants