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

[kinetics] fix TwoTempPlasma documentation #1200

Merged
merged 2 commits into from
Mar 23, 2022
Merged

Conversation

BangShiuh
Copy link
Contributor

@BangShiuh BangShiuh commented Feb 19, 2022

Changes proposed in this pull request

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

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

ischoegl
ischoegl previously approved these changes Feb 19, 2022
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 think there is a similar instance of this that needs to be fixed in reaction.pyx

ischoegl
ischoegl previously approved these changes Feb 19, 2022
@@ -277,7 +277,7 @@ cdef class TwoTempPlasmaRate(ArrheniusTypeRate):

.. math::

k_f = A T_e^b \exp(-\tfrac{E_{a,g}}{RT}) \exp(-\tfrac{E_{a,e}}{RT_e})
k_f = A T_e^b \exp(-\tfrac{E_{a,g}}{RT}) \exp(\tfrac{E_{a,e}(T_e - T)}{R T T_e})

where :math:`A` is the `pre_exponential_factor`, :math:`b` is the
Copy link
Member

Choose a reason for hiding this comment

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

As I mentioned to @speth on #1196, it'd be nice to have the formatting of A, b, etc. be consistent for all the reaction types.

:math:`E_{a,e}` is the `activation_electron_energy`.
where ``A`` is the `pre_exponential_factor`, ``b`` is the
`temperature_exponent`, ``E_{a,g}`` is the `activation_energy`, and
``E_{a,e}`` is the `activation_electron_energy`.
Copy link
Member

Choose a reason for hiding this comment

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

I guess this ends up being a bit confusing, but if these are going to be formatted like code, then I think the names should correspond to the argument names in __cinit__ below (and correspondingly, as this is written in kinetics.rst, e.g. Ea_electron, since this documentation will appear below that constructor signature. But that does kind of conflict with the usual description of the mathematical notation. 🤷

I also realized from looking at https://cantera.org/documentation/dev/sphinx/html/cython/kinetics.html#twotempplasmarate that Sphinx is apparently not smart enough to link to properties defined in a base class, which is a bit unfortunate, so the formatting of pre_exponential_factor, temperature_exponent, and activation_energy doesn't look great, while activation_electron_energy is a link as I would have expected for all four.

Copy link
Member

@ischoegl ischoegl Feb 20, 2022

Choose a reason for hiding this comment

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

Some of the Sphinx issues were introduced by an inheritance structure that was meant to cut down redundant code (which I believe was after the class was initially introduced). There may be ways to tell Sphinx what to do by adding the base class? Fwiw, the formatting can be also checked from the artifacts for each successful GH run (e.g. the docs on the bottom of the page here)

Copy link
Member

Choose a reason for hiding this comment

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

Fwiw, `pre_exponential_factor <ArrheniusTypeRate.pre_exponential_factor>` works ...

.vscode/settings.json Outdated Show resolved Hide resolved
@BangShiuh BangShiuh force-pushed the patch-1 branch 2 times, most recently from 42eadde to 43d2cf6 Compare March 11, 2022 23:01
interfaces/cython/cantera/reaction.pyx Outdated Show resolved Hide resolved
interfaces/cython/cantera/reaction.pyx Outdated Show resolved Hide resolved
include/cantera/kinetics/Arrhenius.h Outdated Show resolved Hide resolved
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.

Thanks, @BangShiuh, I think this looks fine. There are some larger-scale consistency issues with how best to write values that are some combination of function arguments, variables with mathematical notation, and properties of different objects, but I think what's written here is reasonably clear, and I don't think we need to solve that broader problem right now.

@speth speth merged commit fabc907 into Cantera:main Mar 23, 2022
@BangShiuh BangShiuh deleted the patch-1 branch April 29, 2022 16:36
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