-
-
Notifications
You must be signed in to change notification settings - Fork 341
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
Fix external cantera cimport #1470
Conversation
2ada466
to
4430de5
Compare
Codecov Report
@@ Coverage Diff @@
## main #1470 +/- ##
==========================================
+ Coverage 69.86% 69.88% +0.01%
==========================================
Files 377 377
Lines 57298 57298
Branches 19164 19164
==========================================
+ Hits 40033 40040 +7
+ Misses 14712 14705 -7
Partials 2553 2553
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
4430de5
to
4c04d86
Compare
Realized that there was another missing |
Fwiw, I successfully tested the external interface here on macOS and Linux. |
cdef extern from "cantera/base/ct_defs.h" namespace "Cantera": | ||
cdef double CxxAvogadro "Cantera::Avogadro" | ||
cdef double CxxGasConstant "Cantera::GasConstant" | ||
cdef double CxxOneAtm "Cantera::OneAtm" |
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.
Do these need to be exposed as the names CxxOneAtm
etc? They should also available using the Python names one_atm
etc if you use both import cantera as ct
as well as cimport cantera as ct
.
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 less concerned about CxxOneAtm
than some of the more fundamental constants, where a cimport
is imho the cleaner route. Overall, I mainly added the constants as the missing file was an outlier in the interface.
Fix broken
__init__.pxd
file, which is required for the compilation of external Cython code. The file refers to_cantera.pxd
, which was removed / split into multiple files in #1334. This PR adds all individual*.pxd
files Cantera provides in its interface.With this fix, external Cython modules can again access content via
cimport cantera as ct
If applicable, fill in the issue number this pull request is fixing
Closes #1469
Checklist
scons build
&scons test
) and unit tests address code coverage