-
-
Notifications
You must be signed in to change notification settings - Fork 349
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
Simplify Python extension loading and other Python improvements #1456
Conversation
Let Cython handle the complexity of loading the extension module after Python has already been initialized. In the case of a non-Python main program, all we have to do is initialize Python and import the Cantera Python module.
Codecov Report
@@ Coverage Diff @@
## main #1456 +/- ##
==========================================
+ Coverage 69.86% 69.92% +0.06%
==========================================
Files 373 377 +4
Lines 56684 57262 +578
Branches 18883 19151 +268
==========================================
+ Hits 39600 40043 +443
- Misses 14571 14669 +98
- Partials 2513 2550 +37
... and 26 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
@speth ... this looks great overall. The only item I'd request would be a todo
comment to move sentinels to C++ after Cantera 3.0.
I created an issue (#1457) to track the needed feature. I think that's preferable to a to-do item buried somewhere in the code. |
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 created an issue (#1457) to track the needed feature. I think that's preferable to a to-do item buried somewhere in the code.
Thanks for creating the issue! I agree that it is preferable to a todo
.
It did, however, occur to me that SolutionArray
needs a similar sentinel, somewhere around here:
cantera/interfaces/cython/cantera/composite.py
Lines 558 to 559 in fbfd93f
def __init__(self, phase, shape=(0,), states=None, extra=None, meta={}, init=True): | |
self._phase = phase |
Even prior to the introduction of C++
SolutionArray
, adding species would have created inconsistencies in stored data.
PS: Another item I noticed is that we may want to test with Cython 3.0 again?
Currently used for testing pre-release versions of Cython
I've added the Python I've also added a new CI job that runs only after pushes to |
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, @speth … everything looks good to me!
Changes proposed in this pull request
NotImplementedError
to Python nativeNotImplementedError
_SolutionBase._references
Checklist
scons build
&scons test
) and unit tests address code coverage