Skip to content

[Cantera 2.5] Update valve/etc. in science section#104

Merged
speth merged 3 commits into
Cantera:mainfrom
ischoegl:update-science-667
Feb 12, 2021
Merged

[Cantera 2.5] Update valve/etc. in science section#104
speth merged 3 commits into
Cantera:mainfrom
ischoegl:update-science-667

Conversation

@ischoegl
Copy link
Copy Markdown
Member

@ischoegl ischoegl commented May 16, 2020

Addresses @speth's comment in Cantera/cantera#667

The one remaining to-do for this change is to update the "science" documentation for the reactor model on cantera.org (https://cantera.org/science/reactors.html#reactor-networks-and-devices).

Per @bryanwweber's comment in #88, the update should be parked as a PR until the release of 2.5.

@ischoegl ischoegl marked this pull request as draft May 16, 2020 13:35
@bryanwweber
Copy link
Copy Markdown
Member

@ischoegl You can rebase this onto master now

@bryanwweber bryanwweber changed the base branch from master to main July 2, 2020 12:16
@bryanwweber
Copy link
Copy Markdown
Member

@ischoegl What's the status of this PR? Thanks!

@ischoegl
Copy link
Copy Markdown
Member Author

ischoegl commented Jul 2, 2020

@bryanwweber ... will have to look over recent changes on the MFC. Will certainly tackle this as soon as beta is reached.

@bryanwweber
Copy link
Copy Markdown
Member

Thanks @ischoegl I agree waiting for beta makes sense.

@ischoegl ischoegl force-pushed the update-science-667 branch from 1a5d7b1 to 8eef115 Compare July 2, 2020 15:35
@ischoegl ischoegl force-pushed the update-science-667 branch 3 times, most recently from 34edb69 to 3f9cff6 Compare September 1, 2020 19:01
@ischoegl ischoegl changed the title WIP: [Cantera 2.5] Update valve/etc. in science section [Cantera 2.5] Update valve/etc. in science section Sep 1, 2020
@ischoegl ischoegl marked this pull request as ready for review September 1, 2020 19:02
Descriptions of mass flow devices (`Valve`, `MassFlowController` and
`PressureController`) are updated due to changes in Cantera/cantera#667.
@ischoegl
Copy link
Copy Markdown
Member Author

ischoegl commented Sep 1, 2020

@bryanwweber ... now that 2.5 is on the horizon, I finally updated the docs.

Copy link
Copy Markdown
Member

@bryanwweber bryanwweber left a comment

Choose a reason for hiding this comment

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

Thank you for updating this! A few formatting comments here. I think it would make more sense to keep the symbols here consistent with the docstrings, keeping K_v instead of c.

One problem is that the :py:meth: role isn't defined, but I can't recall right now how to link to Python documentation methods... I think it's :py:func: with the fully classified name (i.e., MassFlowController.set_time_function). You can shorten the name to just the method by putting a tilde before the class name.

That said, there doesn't actually appear to be any documentation for the various attributes and methods of these classes, see: https://cantera.org/documentation/dev/sphinx/html/cython/zerodim.html#massflowcontroller I'm not sure what happened to those.

Comment thread pages/science/reactors.rst Outdated
Comment thread pages/science/reactors.rst Outdated
Comment thread pages/science/reactors.rst Outdated
Comment thread pages/science/reactors.rst Outdated
Comment thread pages/science/reactors.rst Outdated
Comment thread pages/science/reactors.rst Outdated
@bryanwweber
Copy link
Copy Markdown
Member

@ischoegl Looking at the dev documentation here: https://cantera.org/documentation/dev/sphinx/html/cython/zerodim.html#massflowcontroller I still see K_v as the coefficient symbol. Do the Cython docs also need to be updated? I think people are much more likely to read the Python docs than C++, although I see that the symbols are consistent here with C++.

@ischoegl
Copy link
Copy Markdown
Member Author

ischoegl commented Sep 4, 2020

@bryanwweber ... Yes ... I just realized that I had looked at C++ as well (which is why I deleted my earlier declaration to be done). I agree that Python is the more likely avenue, and am mostly done with updating the docs accordingly.

On a related note, what version of Sphinx are we on? Based on the documentation, we may have access to :py:method:, :py:classmethod:, :py:attribute:, etc. (not familiar with how Nikola pulls parts together, so sorry about the question). Nevermind, looked at the wrong part of the docs.

@ischoegl
Copy link
Copy Markdown
Member Author

ischoegl commented Sep 4, 2020

OK. I force-pushed - I don't think that :py:var: is the correct syntax for referencing class properties - please let me know and I'll update.

Regarding the differences between C++ and Python, all coefficients are now defined for the parent object using the same private member variable FlowDevice::m_coeff in C++ (which is accessed from the derived class using more specific names, e.g. Valve::setValveCoeff). For Python, those coefficients are set using properties, e.g. Valve.valve_coeff. There isn't an equivalent to a class property in C++, which explains the more generic formulation of the C++ docstrings.

@ischoegl
Copy link
Copy Markdown
Member Author

ischoegl commented Sep 4, 2020

@bryanwweber ... finally located the reference I was wondering about: https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#cross-referencing-python-objects (which curiously mentions :py:meth:)

Updated accordingly, so I believe this should be done.

@ischoegl ischoegl requested a review from bryanwweber September 4, 2020 19:04
bryanwweber added a commit that referenced this pull request Feb 10, 2021
Copy link
Copy Markdown
Member

@bryanwweber bryanwweber left a comment

Choose a reason for hiding this comment

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

Thanks @ischoegl!

@bryanwweber
Copy link
Copy Markdown
Member

FYI @speth this will require a few more changes to the docs from Cantera/cantera, I'm working on a PR. We should wait to merge this until after 2.5.1.

@ischoegl
Copy link
Copy Markdown
Member Author

ischoegl commented Feb 10, 2021

ok. I am aware of remaining activity on the website. The only comment I have is that the new behavior will be default starting in 2.5.0, and I am not sure how long it would take before a minor release of 2.5.1.

Hmm ... I may not have gotten the correct impression based on the comment. If I understand, it is scheduled to be merged, but requires some fixes later on ...

@speth speth merged commit c3763fa into Cantera:main Feb 12, 2021
@bryanwweber
Copy link
Copy Markdown
Member

@ischoegl thanks again for updating this. As you can probably see, we've tagged 2.5.1 already which incorporates the fixes to the docs. The problem wasn't with this code, but with the fact that Sphinx doesn't include inherited members by default, so the *.set_... (I forgot the name already 🤣) method from FlowDevice wasn't linking properly to the child classes. It's fixed in Cantera/cantera now, so this is all set.

@ischoegl
Copy link
Copy Markdown
Member Author

ischoegl commented Feb 13, 2021

@bryanwweber .... Ok, thanks! I saw your fix earlier today. Just didn’t quite know about the context earlier. All the best for the rollout!

@ischoegl ischoegl deleted the update-science-667 branch March 28, 2022 12:31
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.

3 participants