-
-
Notifications
You must be signed in to change notification settings - Fork 350
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
Link C++ and Python SolutionArray implementations #1426
Conversation
9686661
to
87aaf27
Compare
Codecov Report
@@ Coverage Diff @@
## main #1426 +/- ##
==========================================
+ Coverage 69.61% 69.87% +0.26%
==========================================
Files 373 373
Lines 55846 56686 +840
Branches 18338 18883 +545
==========================================
+ Hits 38875 39609 +734
- Misses 14516 14564 +48
- Partials 2455 2513 +58
... and 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
e71a4fc
to
7897e25
Compare
2ae1934
to
0787f94
Compare
13b2a17
to
d6b0de9
Compare
366c4dd
to
ca809e8
Compare
This is a squashed commit implementing the following: - Make data shareable and sliceable - Order SolutionArray extra entries - Switch extra to AnyValue - Use AnyValue in addExtra - Set/get extra entries as AnyMap - Set/get components as AnyValue - Refine extra component handling - Add shape information in C++ - Add additional HDF storage modes - Access entries as 'loc' rather than 'index' (This change of nomenclature is inspired by pandas, where the index refers to the indexing column, while location refers to the row. - Update HDF subfolder logic - Address edge cases in HDF Storage wrapper - Fix edge cases in SolutionArray
Files written using legacy HDF format introduced in Cantera 2.5. All files are created based on the test suite of Cantera 2.6. Note: legacy (h5py-based) writer removed in Cantera 3.0; format remains readable with native (HighFive-based) HDF support.
Base class SolutionArrayBase (implemented in solythonbase.pyx) is used as interface
cf0796b
to
4279e14
Compare
Disable creation of HDF using h5py Redirect SolutionArray.write_hdf to SolutionArray.save in order to prevent new files with deprecated HDF format.
4279e14
to
2259c5c
Compare
2259c5c
to
2bccb33
Compare
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 for the updates, @ischoegl. I have just a couple of remaining comments.
@speth ... I adopted both suggestions/requests. |
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! I think this is good to go. I'm going to ignore the transient failure of the "coverage" builder, as we already have the coverage testing results.
Changes proposed in this pull request
Follow-up to #1385.
SolutionArray
to Python (asSolutionArrayBase
)SolutionArray
formats from Pythonextra
types in C++SolutionArray
that are already available in Python, e.g. entries with typesstring
,long int
,vector<double>
andvector<long int>
(internal handling leveragesAnyValue
)SolutionArray
h5py
support and associated dedicated functions; continue support for pre-existing HDF format with core C++ HDF routines; disable creation of new HDF files with legacy format.With this change, all data available for
SolutionArray
are stored by the C++ core object, with the PythonSolutionArray
serving as an external API. At the same time, all property calculations are still handled by the Python interface, although states are being updated in the C++ core.Due to the size of the PR, some additional features are postponed for a follow-up:
SolutionArray.write_hdf
capabilities forSolutionArray.save
: e.g. default group namesSolutionArray::show()
with ascii pandas-style formatting.SolutionArray
picklable/copyable (via YAML)ReactorNet.save
implementation for single-reactor networksH5Ldelete
see SO post, which is exposed in HighFive asunlink
(see declaration)If applicable, fill in the issue number this pull request is fixing
Resolves Cantera/enhancements#137
If applicable, provide an example illustrating new features this pull request is introducing
While the way data are handled internally is completely refactored, most changes are completely under the hood, with
SolutionArray.save
andSolutionArray.restore
being an exception.Checklist
scons build
&scons test
) and unit tests address code coverage