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

Deprecate magic numbers for RxnRates.h and Falloff.h #733

Merged
merged 3 commits into from
Nov 8, 2019

Conversation

ischoegl
Copy link
Member

@ischoegl ischoegl commented Oct 24, 2019

Changes proposed in this pull request:

  • Deprecate unused magic number int type() methods in RxnRates.h.
  • Deprecate magic numbers int getType() and introduce string type() in Falloff.h

I am leaving the remaining magic numbers for kinetics objects as they are, as it may make sense to convert handling of various types to factories instead of having things hard-coded (this is more elaborate and should be handled by a separate PR).

@ischoegl ischoegl changed the title Deprecate magic number types in RxnRates.h Deprecate magic numbers for RxnRates.h and Falloff.h Oct 25, 2019
@codecov
Copy link

codecov bot commented Oct 25, 2019

Codecov Report

Merging #733 into master will decrease coverage by 0.03%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #733      +/-   ##
==========================================
- Coverage   70.86%   70.82%   -0.04%     
==========================================
  Files         374      374              
  Lines       43683    43703      +20     
==========================================
  Hits        30954    30954              
- Misses      12729    12749      +20
Impacted Files Coverage Δ
include/cantera/kinetics/FalloffFactory.h 100% <ø> (ø) ⬆️
include/cantera/kinetics/RxnRates.h 92.78% <ø> (ø) ⬆️
src/kinetics/Reaction.cpp 87.58% <100%> (-0.05%) ⬇️
test/kinetics/kineticsFromScratch.cpp 100% <100%> (ø) ⬆️
include/cantera/kinetics/Falloff.h 52.5% <33.33%> (-15.36%) ⬇️
src/kinetics/FalloffFactory.cpp 54.54% <81.81%> (-45.46%) ⬇️

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 ce47733...0ca7889. Read the comment docs.

Copy link
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.

I'm always glad to see magic numbers go away, and this looks pretty good to me. I had just a couple of minor comments / questions.

src/kinetics/FalloffFactory.cpp Outdated Show resolved Hide resolved
interfaces/cython/cantera/reaction.pyx Outdated Show resolved Hide resolved
src/kinetics/Reaction.cpp Outdated Show resolved Hide resolved
@ischoegl
Copy link
Member Author

ischoegl commented Nov 2, 2019

I switched the type string to "Lindemann" to make things clear for the simple falloff type, and also added some rudimentary tests for the falloff reaction type to the suite.

@speth speth merged commit 21de00c into Cantera:master Nov 8, 2019
@ischoegl ischoegl deleted the deprecate-rxnrates-type branch December 16, 2019 15:55
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