Skip to content

Commit 85ce427

Browse files
committed
Update CMakeLists.txt to pass simulator type to docstring generator
- Add 'BlackOil' as 5th parameter to generate_docstring_hpp.py - Prepares for template-based docstring generation - Will work with updated opm-common generate_docstring_hpp.py script
1 parent 7b596ed commit 85ce427

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

python/docstrings_simulators.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"_usage_information": "This file defines documentation for OPM Python simulator bindings. It uses a template format where {{name}} is replaced with the simulator name (e.g., BlackOilSimulator) and {{class}} with the internal class name (e.g., PyBlackOilSimulator). The 'simulators' section defines available simulators, 'constructors' defines shared constructor documentation, and 'common_methods' defines documentation for methods shared by all simulators. This file is processed by: (1) opm-common/python/generate_docstring_hpp.py to generate C++ header files with docstrings, (2) opm-python-documentation/.../sphinx_ext_docstrings.py to generate Sphinx documentation. To add a new simulator, add an entry to the 'simulators' section with 'class', 'name', and 'doc' fields.",
23
"simulators": {
34
"BlackOil": {
45
"class": "PyBlackOilSimulator",

python/simulators/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ add_custom_command(
1616
OUTPUT ${PYTHON_DOCSTRINGS_GENERATED_HPP}
1717
COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${CMAKE_SOURCE_DIR}
1818
${PYTHON_EXECUTABLE} ${PYTHON_GENERATE_DOCSTRINGS_PY}
19-
${PYTHON_DOCSTRINGS_FILE} ${PYTHON_DOCSTRINGS_GENERATED_HPP} PYBLACKOILSIMULATORDOC_HPP "Opm::Pybind::DocStrings"
19+
${PYTHON_DOCSTRINGS_FILE} ${PYTHON_DOCSTRINGS_GENERATED_HPP} PYBLACKOILSIMULATORDOC_HPP "Opm::Pybind::DocStrings" "BlackOil"
2020
DEPENDS ${PYTHON_DOCSTRINGS_FILE}
2121
COMMENT "Generating PyBlackOilSimulatorDoc.hpp from JSON file"
2222
)

0 commit comments

Comments
 (0)