-
-
Notifications
You must be signed in to change notification settings - Fork 372
Experimental CLib zeroD API #1878
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
Conversation
0beb045
to
e8e6bd9
Compare
Introduce convenience methods similar to those introduced in ConnectorFactory. Implement transitional behavior for updated newReactor and add new newReservoir function. Further, introduce virtual FlowDevice methods to avoid casting.
e8e6bd9
to
7576bf6
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1878 +/- ##
==========================================
- Coverage 74.33% 74.08% -0.25%
==========================================
Files 443 443
Lines 55403 55488 +85
Branches 9108 9118 +10
==========================================
- Hits 41183 41108 -75
- Misses 11122 11285 +163
+ Partials 3098 3095 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
7576bf6
to
40fed9e
Compare
@speth ... this is the last portion missing before the experimental CLib reaches parity with the traditional CLib API. Let me know if this needs further work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @ischoegl. This largely looks good to me. Just a handful of suggestions.
def device_coefficient(self): | ||
""" | ||
Device coefficient (defined by derived class). | ||
|
||
Example: | ||
|
||
>>> v = Valve(res1, reactor1) | ||
>>> v.device_coefficient = 1e-4 # Set the 'valve coefficient' | ||
|
||
.. versionadded:: 3.2 | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the rationale for creating a generic interface for setting this coefficient in the CLib case, but I'm concerned that in the Python case, this is just creating a redundant interface that parallels the existing PressureController.pressure_coeff
and MassFlowContoller.mass_flow_coeff
properties.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I implemented this as I was hoping to have mostly parallel implementations on all APIs. At the same time, I wasn't sure that I wanted to deprecate (in both C++ and Python). If you want me to make a decision, I'd be in favor of device_coefficient
as it is a more efficient implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with having both options in place for now, with the idea that we might eventually deprecate the device-specific implementation in favor of the generic approach.
@speth ... thanks for the review! I addressed all suggestions, with the exception of the last one, where I am conflicted on whether to deprecate the earlier coefficient getters/setters. |
Changes proposed in this pull request
With this PR,
clib_experimental
reaches parity with the traditionalclib
.zeroD
objects to experimental CLibReactorNet
with list ofReactorBase
; deprecate incremental path viaaddReactor
newReservoir
) and clarify future use ofnewReactor
.samples
... previously overlooked due to C++ samples not checked for use of deprecated methods #1603If applicable, fill in the issue number this pull request is fixing
Addresses Cantera/enhancements#220
If applicable, provide an example illustrating new features this pull request is introducing
Checklist
scons build
&scons test
) and unit tests address code coverage