Skip to content

Isodesmic improvements#2217

Closed
amarkpayne wants to merge 22 commits intomainfrom
isodesmic_improvements
Closed

Isodesmic improvements#2217
amarkpayne wants to merge 22 commits intomainfrom
isodesmic_improvements

Conversation

@amarkpayne
Copy link
Copy Markdown
Member

Motivation or Problem

There are a few improvements I made to the isodesmic reactions code in RMG as part of the work on an upcoming BACs paper. With these improvements, isodesmic reactions show similar performance to BACs under certain conditions.

Description of Changes

The biggest change is adding in higher order isodesmic schemes

Testing

I used this branch to generate data/plots for the upcomming BACs paper. I can share a talk on this to help with the review.

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Oct 18, 2021

This pull request introduces 1 alert when merging 038bca4 into 47c4e0b - view on LGTM.com

new alerts:

  • 1 for Unused import

@kspieks
Copy link
Copy Markdown
Contributor

kspieks commented Oct 18, 2021

At a first look, this PR looks good. As minor changes:

Copy link
Copy Markdown
Contributor

@davidfarinajr davidfarinajr 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 these improvements @amarkpayne ! Overall, it is looking very good. Nice work! I did find one bug for generating allowable_charges for anions (see comments). Also, I see that there are 2 unit tests that are failing. I though that they are failing because of the new limit_scope feature which default setting is True. However, it turns out that this is not the case. I need to do a little more digging to see why these tests are failing

connections = []
for a, b in atom.bonds.items():
ac = AtomConstraint(label=f'{a.symbol}{a.connectivity1}')
bond_order = b.order
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we use int(bond.order) here (which we are using above in _buerger_rc2 and _buerger_rc3)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks for the catch!

new_constraints = []

if charge < 0:
allowable_charges = list(range(charge, 0))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we want to include neutral charge species, we should change this to allowable_charges = list(range(charge, 1))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, thanks for the catch!

Copy link
Copy Markdown
Member Author

@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.

Thanks for the comments @davidfarinajr ! I finally got around to these fixes, and I think this should be good to go now. Let me know what you think

connections = []
for a, b in atom.bonds.items():
ac = AtomConstraint(label=f'{a.symbol}{a.connectivity1}')
bond_order = b.order
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks for the catch!

new_constraints = []

if charge < 0:
allowable_charges = list(range(charge, 0))
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, thanks for the catch!

@amarkpayne amarkpayne force-pushed the isodesmic_improvements branch from 038bca4 to 0ab32e4 Compare February 28, 2022 16:07
Adding charge as a constraint broke pyomo, but it is unclear how. lpsolve works fine. This commit is needed until a fix is implemented
Each time a new reaction is found, eliminate subsets from the queue that contain all the indices of every species in that reaction. If such a subset was run, it would be possible to arrive at the same reaction.
It is not needed, as we always do this before solving, and it can lead to an error if the constraint matrix is not solvable (this method return None to signal this)
Every subset added is a strict subset of the ones that came before it. Therefore, it is redundant to keep checking previously found reactions
Many of the charged species throw warnings, but they are actually being handled properly
Our code is able to tell when pyomo fails and deals with it properly
For consistent behavior with pyomo
This actually seems to increase performance and saves time
We should only test if the thermo is within a reasonable range, and that more than one reaction is found
@amarkpayne amarkpayne force-pushed the isodesmic_improvements branch from 0ab32e4 to 4259d1e Compare March 1, 2022 22:33
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 2, 2022

Codecov Report

Merging #2217 (4259d1e) into main (1d67d94) will decrease coverage by 0.82%.
The diff coverage is 83.50%.

❗ Current head 4259d1e differs from pull request most recent head 5e8919b. Consider uploading reports for the commit 5e8919b to get more accurate results

@@            Coverage Diff             @@
##             main    #2217      +/-   ##
==========================================
- Coverage   48.49%   47.67%   -0.82%     
==========================================
  Files         110      105       -5     
  Lines       30758    28275    -2483     
  Branches     8039     7479     -560     
==========================================
- Hits        14917    13481    -1436     
+ Misses      14318    13343     -975     
+ Partials     1523     1451      -72     
Impacted Files Coverage Δ
arkane/encorr/isodesmic.py 79.44% <82.81%> (-0.98%) ⬇️
arkane/encorr/reference.py 71.32% <100.00%> (+0.86%) ⬆️

... and 50 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@github-actions
Copy link
Copy Markdown

This pull request is being automatically marked as stale because it has not received any interaction in the last 90 days. Please leave a comment if this is still a relevant pull request, otherwise it will automatically be closed in 30 days.

@github-actions github-actions bot added the stale stale issue/PR as determined by actions bot label Jun 21, 2023
@amarkpayne
Copy link
Copy Markdown
Member Author

@JacksonBurns this PR should make its way into RMG at some point. If you want I can take one last look at it, update it to main, and then merge it in. Also happy to wait for approval if someone on the team wants to take over as reviewer. @oscarwumit is working on the manuscript for this, so he might be the most familiar person there.

@github-actions github-actions bot removed the stale stale issue/PR as determined by actions bot label Jun 22, 2023
@JacksonBurns
Copy link
Copy Markdown
Contributor

@amarkpayne thanks for the update! I am going to resolve the conflicts in the environment.yml file and see if this is still close to merging. Please give it another look once the CI gets underway.

@JacksonBurns JacksonBurns mentioned this pull request Jul 25, 2023
@github-actions
Copy link
Copy Markdown

This pull request is being automatically marked as stale because it has not received any interaction in the last 90 days. Please leave a comment if this is still a relevant pull request, otherwise it will automatically be closed in 30 days.

@github-actions github-actions bot added the stale stale issue/PR as determined by actions bot label Sep 21, 2023
@github-actions github-actions bot added the abandoned abandoned issue/PR as determined by actions bot label Oct 22, 2023
@github-actions github-actions bot closed this Oct 22, 2023
@JacksonBurns
Copy link
Copy Markdown
Contributor

In the time since this PR was opened, the new pyutillib dependency has ceased development. Refactoring this PR to deal with this is currently not in the cards, so I'm going to remove the stale and abandoned labels and soft reject this PR.

@JacksonBurns JacksonBurns removed stale stale issue/PR as determined by actions bot abandoned abandoned issue/PR as determined by actions bot labels Oct 22, 2023
@JacksonBurns JacksonBurns deleted the isodesmic_improvements branch October 22, 2023 20:59
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.

4 participants