Skip to content

Delegating reactor#1130

Closed
chinahg wants to merge 25 commits into
Cantera:mainfrom
chinahg:delegating-reactor
Closed

Delegating reactor#1130
chinahg wants to merge 25 commits into
Cantera:mainfrom
chinahg:delegating-reactor

Conversation

@chinahg
Copy link
Copy Markdown
Member

@chinahg chinahg commented Oct 23, 2021

Changes proposed in this pull request

  • Added capability to modify governing equations in Cantera reactors in python

If applicable, fill in the issue number this pull request is fixing

Closes #

If applicable, provide an example illustrating new features this pull request is introducing

Checklist

  • [x ] The pull request includes a clear description of this code change
  • [ x] Commit messages have short titles and reference relevant issues
  • [ x] Build passes (scons build & scons test) and unit tests address code coverage
  • [ x] Style & formatting of contributed code follows contributing guidelines
  • [ x] The pull request is ready for review

speth added 20 commits October 29, 2021 12:35
For 'after' delegates, if the return code from the wrapped function is
non-zero, then the delegate's return value will be the sum of the
values from the base and wrapped functions.
Avoids name clashes with existing Python names that may have different
method signatures, e.g. Reactor.get_state.
The function for evaluating dy/dt no longer needs the vector of
sensitivity parameters, and should not operate directly on the state
vector (which should be processed by updateState).
@chinahg chinahg force-pushed the delegating-reactor branch from af59e7d to 3df450c Compare October 29, 2021 17:54
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 29, 2021

Codecov Report

Merging #1130 (95f3c21) into main (4570f3e) will increase coverage by 0.14%.
The diff coverage is 83.19%.

❗ Current head 95f3c21 differs from pull request most recent head ff6f6a8. Consider uploading reports for the commit ff6f6a8 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1130      +/-   ##
==========================================
+ Coverage   73.49%   73.64%   +0.14%     
==========================================
  Files         365      372       +7     
  Lines       48187    49257    +1070     
==========================================
+ Hits        35417    36273     +856     
- Misses      12770    12984     +214     
Impacted Files Coverage Δ
include/cantera/base/AnyMap.h 100.00% <ø> (ø)
include/cantera/base/Solution.h 100.00% <ø> (ø)
include/cantera/base/YamlWriter.h 100.00% <ø> (ø)
include/cantera/base/global.h 93.33% <ø> (ø)
include/cantera/base/utilities.h 100.00% <ø> (ø)
include/cantera/base/xml.h 100.00% <ø> (ø)
include/cantera/equil/MultiPhase.h 100.00% <ø> (ø)
include/cantera/kinetics/FalloffFactory.h 100.00% <ø> (ø)
include/cantera/kinetics/GasKinetics.h 100.00% <ø> (ø)
include/cantera/kinetics/Kinetics.h 55.26% <0.00%> (-1.50%) ⬇️
... and 157 more

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 4570f3e...ff6f6a8. Read the comment docs.

Copy link
Copy Markdown
Member

@speth speth left a comment

Choose a reason for hiding this comment

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

Thanks, @chinahg for opening this PR. I think most of the comments I have were about formatting issues. I see in the commit history a bit of "churn" where certain changes are made and then mostly undone in subsequent commits. I hope you can do a little tidying-up of these so that each commit stands alone as a complete and functional idea.

Comment thread --from-history Outdated
Comment thread include/cantera/zeroD/Reactor.h Outdated
Comment thread include/cantera/zeroD/Reactor.h Outdated
Comment thread include/cantera/zeroD/Reactor.h Outdated
Comment thread interfaces/cython/cantera/test/test_reactor.py Outdated
Comment thread src/zeroD/Reactor.cpp Outdated
Comment thread src/zeroD/ReactorNet.cpp Outdated
Comment thread src/zeroD/ReactorNet.cpp Outdated
Comment thread src/zeroD/ReactorNet.cpp Outdated
Comment thread src/zeroD/ReactorNet.cpp
@speth
Copy link
Copy Markdown
Member

speth commented Nov 18, 2021

@chinahg - One additional thing -- the tests which run the Python examples are failing because interfaces/cython/cantera/examples/reactors/custom2.py needs to be updated to use the new LHS/RHS version of eval.

@chinahg chinahg force-pushed the delegating-reactor branch from 3df450c to 7dcaea8 Compare December 6, 2021 19:54
 Implemented LHS/RHS notation in eval functions of Reactor classes

 Updated ReactorDelegator for new eval arguments
Required for LHS/RHS arguments

Added name to authors list
Whitespace deletions, unnecessary comment removal, Doxygen string formatting
@chinahg chinahg force-pushed the delegating-reactor branch from 7dcaea8 to ff6f6a8 Compare December 6, 2021 23:15
@speth
Copy link
Copy Markdown
Member

speth commented Dec 17, 2021

The additional commits here have now been incorporated back into #1003, so I'm going to close this PR.

@speth speth closed this Dec 17, 2021
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