Skip to content

Add template support for generate_docstring_hpp.py#4690

Merged
blattms merged 1 commit into
OPM:masterfrom
hakonhagland:docstring-hpp-template
Sep 17, 2025
Merged

Add template support for generate_docstring_hpp.py#4690
blattms merged 1 commit into
OPM:masterfrom
hakonhagland:docstring-hpp-template

Conversation

@hakonhagland

@hakonhagland hakonhagland commented Aug 22, 2025

Copy link
Copy Markdown
Contributor

We need to extend the docstring extraction method to accommodate for multiple opm simulator python modules. Previously, there was only opm.simulators.BlackOilSimulator, now (see OPM/opm-simulators#6075) there will also be a GasWaterSimulator (and possibly more in the future). To avoid docstring duplication among the different simulators, a template system was implemented see OPM/opm-simulators#6418 and OPM/opm-python-documentation#17 for more information.

- Accept optional 5th parameter for simulator type
- Detect template format (with 'simulators' and 'common_methods' keys)
- Expand templates by replacing {{name}} and {{class}} placeholders
- Maintain backward compatibility for flat JSON format
- Generate simulator-specific docstring headers from single template
@hakonhagland

Copy link
Copy Markdown
Contributor Author

jenkins build this please

@akva2 akva2 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine. I wonder if the flat format is quickly turning into unused cruft, but we can keep it for now..

@akva2

akva2 commented Sep 12, 2025

Copy link
Copy Markdown
Member

jenkins build this opm-simulators=6418 please

@akva2

akva2 commented Sep 12, 2025

Copy link
Copy Markdown
Member

jenkins build this please

@blattms blattms merged commit 3982515 into OPM:master Sep 17, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual:irrelevant This PR is a minor fix and should not appear in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants