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 bug with duplicate library reactions #1676

Merged
merged 2 commits into from
Aug 9, 2019
Merged

fix bug with duplicate library reactions #1676

merged 2 commits into from
Aug 9, 2019

Conversation

mjohnson541
Copy link
Contributor

This sets the rxn.family attribute to the name of the library it was loaded from rather than the library it was originally from this prevents reactions in a seed mechanism that were originally from a reaction library from being duplicated if that reaction library is used as a reaction library or seed mechanism.

@mjohnson541 mjohnson541 self-assigned this Aug 8, 2019
@mjohnson541 mjohnson541 requested a review from alongd August 8, 2019 17:12
@alongd
Copy link
Member

alongd commented Aug 8, 2019

I guess you guys already discussed it, but seems like we're misusing the family attribute. Also, won't that end in a weird comment in the mechanism file, such as From reaction family: KnownLibrary?

@mjohnson541
Copy link
Contributor Author

The comments will be the same. It isn't exactly a misuse, LibraryReaction already had a family attribute that was identical to the original library, now the family attribute is the library it was loaded from. That doesn't exactly make it a clear solution to the problem, but it does make sense in context.

@codecov
Copy link

codecov bot commented Aug 8, 2019

Codecov Report

Merging #1676 into master will decrease coverage by <.01%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1676      +/-   ##
==========================================
- Coverage   41.81%   41.81%   -0.01%     
==========================================
  Files         177      177              
  Lines       30206    30207       +1     
  Branches     6252     6252              
==========================================
  Hits        12630    12630              
- Misses      16654    16655       +1     
  Partials      922      922
Impacted Files Coverage Δ
rmgpy/data/kinetics/library.py 43.1% <33.33%> (-0.11%) ⬇️

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 e9a650d...ac6162f. Read the comment docs.

@mliu49
Copy link
Contributor

mliu49 commented Aug 8, 2019

For documentation purposes, the second commit is to address issues I've had with loading reaction libraries with the comment Originally from reaction library: Unclassified, which is appended whenever one imports a Chemkin file in as a reaction library.

I think it's safer to only do the additional parsing for autoGenerated libraries.

This sets the rxn.family attribute to the name of the library it was loaded from
rather than the library it was originally from
this prevents reactions in a seed mechanism that were originally from
a reaction library from being duplicated if that reaction library is used
as a reaction library or seed mechanism
@mjohnson541
Copy link
Contributor Author

@alongd does this solve your issue?

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 for the fixes and explanations!

@alongd alongd merged commit 1029f90 into master Aug 9, 2019
@alongd alongd deleted the fixSeedLibraryLoad branch August 9, 2019 14:49
@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.

3 participants