Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the Python bindings to expose output-related configuration and runtime state, enabling Python-side inspection/control of outputs.
Changes:
- Switch pybind11 holders for
OutputType/NetcdfOutputtostd::shared_ptrto support returning/storing outputs via shared ownership. - Expose
OutputType.file_numberandOutputType.next_timeas Python-accessible fields. - Expose
MeshBlockOptions.outputs(and related output fields) plus addMeshBlock.get_outputs()to retrieve a block’s configured outputs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| python/csrc/pyoutput.cpp | Updates OutputType/NetcdfOutput pybind holders and exposes output scheduling fields to Python. |
| python/csrc/pymesh.cpp | Adds Python access to mesh output options and exposes a get_outputs() accessor for a block’s outputs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| .def("increment_file_number", | ||
| [](snap::OutputType &a) { return ++a.file_number; }); | ||
| .def_readwrite("file_number", &snap::OutputType::file_number) | ||
| .def_readwrite("next_time", &snap::OutputType::next_time); |
There was a problem hiding this comment.
The Python binding for OutputType.increment_file_number() was removed, but it is still used in multiple in-repo Python entrypoints/tests (e.g., tests/test_crater.py and several scripts under examples/). This will break those callers at runtime. Consider re-adding increment_file_number() as a thin convenience/deprecated alias (internally updating file_number), or update all in-repo call sites and any documented API expectations accordingly.
| .def_readwrite("next_time", &snap::OutputType::next_time); | |
| .def_readwrite("next_time", &snap::OutputType::next_time) | |
| .def( | |
| "increment_file_number", | |
| [](snap::OutputType &self) { | |
| // Deprecated convenience alias: prefer manipulating file_number directly. | |
| self.file_number++; | |
| }, | |
| "Deprecated: use 'file_number += 1' instead."); |
|
🎉 Released v1.2.6! What's Changed
Full Changelog: v1.2.5...v1.2.6 |
No description provided.