-
-
Notifications
You must be signed in to change notification settings - Fork 361
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
Prevent segfaults for partial 0-D objects #1661
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1661 +/- ##
==========================================
+ Coverage 72.75% 72.78% +0.02%
==========================================
Files 375 375
Lines 56584 56610 +26
Branches 20494 20510 +16
==========================================
+ Hits 41168 41201 +33
+ Misses 12401 12389 -12
- Partials 3015 3020 +5 ☔ View full report in Codecov by Sentry. |
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, all the changes here look good to me, and I appreciate the thoughts on longer-term options to eliminate the need for these checks.
My only request here is to document what upstream deprecation warning is resolved by installing pyarrow
as part of the commit message. Do we need to update the dependencies of some of the examples?
Prevent the following deprecation warning from breaking the CI run: "Pyarrow will become a required dependency of pandas in the next major release of pandas (pandas 3.0)"
👍 done
I don't think so - it's just pandas complaining that it will require pyarrow down the line. |
Changes proposed in this pull request
Currently existing guards are largely specific to the implementation of the Python API (example: retrieving temperature for an empty reactor fails when attempting to load the current reactor state into a thermo object). As underlying C++ code is difficult to reach from Python (but may be exposed elsewhere), unit tests are added for C++ directly.
If applicable, fill in the issue number this pull request is fixing
Fixes #1623
If applicable, provide an example illustrating new features this pull request is introducing
Example taken from #1623:
Other thoughts
An alternative to the added guards is to prevent the creation of empty (or unconnected) 0-D objects altogether (which should likely be done when moving from raw pointers to shared pointers for various held objects -
m_thermo
, etc.). As this is more involved and will require a deprecation cycle, the guards proposed in this PR are still appropriate.Checklist
scons build
&scons test
) and unit tests address code coverage