Skip to content

Commit

Permalink
Merge pull request #4428 from lisajulia/documentation/python
Browse files Browse the repository at this point in the history
Add missing documentation for EclipseState class
  • Loading branch information
blattms authored Jan 15, 2025
2 parents 51be6b1 + dd2eb9e commit 990bbbb
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 7 deletions.
14 changes: 7 additions & 7 deletions python/cxx/eclipse_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ void python::common::export_EclipseState(py::module& module) {
// opm.simulators.BlackOilSimulator Python object
//
py::class_< EclipseState, std::shared_ptr<EclipseState> >( module, "EclipseState", EclipseStateClass_docstring)
.def(py::init<const Deck&>())
.def_property_readonly( "title", &EclipseState::getTitle )
.def( "field_props", &get_field_props, ref_internal)
.def( "grid", &EclipseState::getInputGrid, ref_internal)
.def( "config", &EclipseState::cfg, ref_internal)
.def( "tables", &EclipseState::getTableManager, ref_internal)
.def( "has_input_nnc", &EclipseState::hasInputNNC )
.def(py::init<const Deck&>(), py::arg("deck"), EclipseState_init_docstring)
.def_property_readonly( "title", &EclipseState::getTitle, EclipseState_title_docstring)
.def( "field_props", &get_field_props, ref_internal, EclipseState_field_props_docstring)
.def( "grid", &EclipseState::getInputGrid, ref_internal, EclipseState_grid_docstring)
.def( "config", &EclipseState::cfg, ref_internal, EclipseState_config_docstring)
.def( "tables", &EclipseState::getTableManager, ref_internal, EclipseState_tables_docstring)
.def( "has_input_nnc", &EclipseState::hasInputNNC, EclipseState_has_input_nnc_docstring)
.def( "simulation", &EclipseState::getSimulationConfig, ref_internal, EclipseState_simulation_docstring)
.def( "input_nnc", &getNNC, EclipseState_input_nnc_docstring)
.def( "faultNames", &faultNames, EclipseState_faultNames_docstring)
Expand Down
28 changes: 28 additions & 0 deletions python/docstrings_common.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,34 @@
"signature": "opm.io.ecl_state.EclipseState",
"doc": "The EclipseState class - this is a representation of all static properties in the model, ranging from porosity to relperm tables.\nThe content of the EclipseState is immutable and may not be changed at runtime."
},
"EclipseState_init": {
"signature": "opm.io.ecl_state.EclipseState.__init__(deck: Deck) -> EclipseState",
"doc": "Creates an EclipseState from the given Deck.\n\n:param deck: The deck.\n:type deck: Deck\n:return: The EclipseState.\n:type return: EclipseState"
},
"EclipseState_title": {
"signature": "opm.io.ecl_state.EclipseState.title -> str",
"doc": "Returns the title of the EclipseState.\n\n:return: The title.\n:type return: str"
},
"EclipseState_field_props": {
"signature": "EclipseState.field_props() -> FieldPropsManager",
"doc": "Returns the field properties for the Eclipse simulation. \n\n:return: The field properties for the simulation.\n:type: FieldPropsManager"
},
"EclipseState_grid": {
"signature": "EclipseState.grid() -> EclipseGrid",
"doc": "Returns the EclipseGrid used for the Eclipse simulation.\n\n:return: The grid used in the simulation.\n:type: EclipseGrid"
},
"EclipseState_config": {
"signature": "EclipseState.config() -> EclipseConfig",
"doc": "Returns the configuration for the Eclipse simulation.\n\n:return: The simulation configuration.\n:type: EclipseConfig"
},
"EclipseState_tables": {
"signature": "EclipseState.tables() -> TableManager",
"doc": "Returns the table manager associated with the Eclipse simulation.\n\n:return: The table manager for the simulation.\n:type: TableManager"
},
"EclipseState_has_input_nnc": {
"signature": "EclipseState.has_input_nnc() -> bool",
"doc": "Checks whether the Eclipse simulation contains input for non-neighboring connections.\n\n:return: True if the simulation has NNC input, otherwise False.\n:type: bool"
},
"EclipseState_input_nnc": {
"signature": "opm.io.ecl_state.EclipseState.input_nnc() -> list",
"doc": "Returns a list of non-neighboring connections.\n\nOne non-neighboring connection is a tuple containing the following elements:\n\n- index1 (int): Index of the first cell.\n\n- index2 (int): Index of the second cell.\n\n- transmissibility (double): Transmissibility between the two cells.\n\n:return: A list of non-neighboring connections. \n:type return: list"
Expand Down

0 comments on commit 990bbbb

Please sign in to comment.