equinor / ert

ERT - Ensemble based Reservoir Tool - is designed for running ensembles of dynamical models such as reservoir models, in order to do sensitivity analysis and data assimilation. ERT supports data assimilation using the Ensemble Smoother (ES), Ensemble Smoother with Multiple Data Assimilation (ES-MDA) and Iterative Ensemble Smoother (IES).
https://ert.readthedocs.io/en/latest/
GNU General Public License v3.0
98 stars 104 forks source link

Update plugin documentation & refine plugin interface #8257

Open eivindjahren opened 5 days ago

eivindjahren commented 5 days ago

In https://github.com/equinor/ert/commit/4f363cc0257b658d01c71125118fca6b654a578d & https://github.com/equinor/ert/commit/ceda74fdd18d8df31685288578cfa2b034d839b2 , a new way of handling

import ert

@ert.plugin
def installable_forward_model_steps():
    ...

in such a way that a plugin implementer does not need to import hook_implementation & plugin_response.

While at it, we could create a replacement for legacy_ertscript_workflow so that instead of

@hook_implementation
def legacy_ertscript_workflow(config):
    workflow = config.add_workflow(CsvExport2Job, "CSV_EXPORT2")
    workflow.parser = csv_export_parser
    workflow.description = DESCRIPTION
    workflow.examples = EXAMPLES
    workflow.category = "export"

one would have

@ert.plugin
def ertscript():
    return {
        "ertscript": CsvExport2Job,
        "name": "CSV_EXPORT2",
        "parser": csv_export_parser,
        "description": DESCRIPTION,
        "examples": EXAMPLES,
        "category": export
    }