romtools.workflows.models#

Protocol for interfacing with external applications

Classes

Model()

Baseline model protocol

QoiModel()

Protocol for a model that has a return_qoi implementation

QoiModelWithErrorEstimate()

Protocol for a model that has a return_qoi and compute_error_estimate

class romtools.workflows.models.Model[source]#

Bases: Protocol

Baseline model protocol

populate_run_directory(run_directory, parameter_sample)[source]#

This function is called from the base directory and is responsible for populating the run directory located at run_directory.

Examples would be setting up input files, linking mesh files.

Parameters:
  • run_directory (str) – Absolute path to run_directory.

  • parameter_sample (dict) – Dictionary contatining parameter names and sample values

Return type:

None

run_model(run_directory, parameter_sample)[source]#

This function is called from the base directory. It needs to execute our model. If the model runs successfully, return 0. If fails, return 1.

Parameters:
  • run_directory (str) – Absolute path to run_directory.

  • parameter_sample (dict) – Dictionary contatining parameter names and sample values

Return type:

int

class romtools.workflows.models.QoiModel[source]#

Bases: Model, Protocol

Protocol for a model that has a return_qoi implementation

compute_qoi(run_directory, parameter_sample)[source]#

This function is called from a run directory AFTER run_model has been run

Parameters:
  • run_directory (str)

  • parameter_sample (dict)

Return type:

ndarray

class romtools.workflows.models.QoiModelWithErrorEstimate[source]#

Bases: QoiModel, Protocol

Protocol for a model that has a return_qoi and compute_error_estimate

compute_error_estimate(run_directory, parameter_sample)[source]#

This function is called from a run directory AFTER run_model has been run

Parameters:
  • run_directory (str)

  • parameter_sample (dict)

Return type:

float