pyopmspe11.core.pyopmspe11 module#

Command-line entry point and top-level workflow coordination for pyopmspe11.

pyopmspe11 supports four connected workflows for the SPE11 benchmark cases:

  • Deck generation creates OPM Flow input from TOML or legacy configuration.

  • Simulation execution runs OPM Flow for the generated deck.

  • Data processing converts OPM results to sparse, dense, and performance CSVs.

  • Plotting creates benchmark figures or comparisons from generated CSV data.

This module parses and validates command-line arguments, builds the shared configuration, creates output folders, dispatches the selected workflows, and reports generated files. Geometry, file writing, result processing, and plotting are implemented in the utility and visualization modules.

main(argv=None)[source]#

Run the pyopmspe11 command-line workflow.

Parse and validate CLI arguments, initialize the shared configuration, and dispatch the selected deck, Flow, data, plotting, or comparison operations.

Parameters:
argvlist[str] | None, optional

Arguments to parse instead of sys.argv[1:]. This is primarily used by tests and programmatic callers.

Parameters:

argv (list[str] | None)

Return type:

None

_create_directory(path)[source]#

Create an output directory when it does not exist.

Parameters:
pathstr

Input or output path.

Parameters:

path (str)

Return type:

None

_parse_arguments(argv)[source]#

Create the CLI parser and parse pyopmspe11 arguments.

Parameters:
argvlist[str] | None

Arguments to parse instead of sys.argv[1:]. This is primarily used by tests and programmatic callers.

Returns:
argparse.Namespace

Parsed command-line arguments.

Parameters:

argv (list[str] | None)

Return type:

Namespace

_validate_arguments(cmdargs)[source]#

Validate command-line values and incompatible operations.

Validation covers numeric syntax, benchmark-specific restrictions, workflow dependencies, and requested data and plotting modes.

Parameters:
cmdargsargparse.Namespace

Parsed data-generation arguments.

Raises:
SystemExit

If an input value is invalid or required input cannot be used.

Parameters:

cmdargs (Namespace)

Return type:

None