nom_client.results.model_run API documentation

Module nom_client.results.model_run

Class to hold the results of a model run.

Classes

class ModelRun (run_context: nom_client.run_context.RunContext = None, model_results: Dict[str, nom_client.results.model_result.ModelResult] = None, status_code: int = 0, status: str = None, message: str = '', file_outputs=None, result_sources=None)

Class to hold the results of a model run.

Args

run_context : RunContext
Model run run context.
model_results : Dict[str, NumericModelResult]
A list of the model run results.
status_code : int
Status code for the model run.
status : str
Status flag for the model run.
message : str
Message associated with the model run.

Ancestors

  • builtins.dict

Methods

def get_description(self) ‑> str

Returns a description of the model run. :returns: A text description of the ModelRun.

def get_model_result_by_name(self, result_name: str) ‑> Union[NumericModelResult, nom_client.results.model_result.ModelResult]

Returns a model result by name. The name of the model results are specified in the model specification.

Args

result_name : str
Name of the model result.

Returns

NumericModelResult
Model results.
def get_model_result_by_quantity(self, quantity: str, **qualifiers) ‑> Dict[str, Union[NumericModelResult, nom_client.results.model_result.ModelResult]]

Returns a model result by quantity.

Args

quantity : str
The quantity of the model result.
qualifiers : str
Any qualifier filter terms.

Returns

NumericModelResult
Model results.
def get_model_results(self) ‑> Dict[str, Union[NumericModelResult, nom_client.results.model_result.ModelResult]]

Get the list of all model run results. This is documented in the model specification (or online model docs).

Returns

List[str]
A list of model results.
def get_model_run_name(self) ‑> str

Return the model run name.

Returns

str
The name of the model run.
def get_result_count(self) ‑> int

Returns the number of model results.

Returns

int
Number of results.
def get_result_names(self) ‑> List[~AnyStr]

Returns a list of result names continined within the model run.

Returns

List[AnyStr]
The list of model result names within this model run.
def get_run_id(self) ‑> str

Return the unique run ID of this model run.

Returns

str
The unique model run ID.
def has_completed(self) ‑> bool

Returns True if the model run has completed.

Returns

bool
Returns true if the model run completed.
def has_model_result_by_name(self, result_name: str) ‑> bool

Does the model run have a model result.

Args

result_name : str
Name of the model result.

Returns

bool
Does the model result exist?
def has_run(self) ‑> bool

Returns true if the model run was run.

Returns

bool
Returns true if the model run was run.
def is_successful(self) ‑> bool

Returns if the model ran successfully or not.

Returns

bool
True if the model ran successfully.
def to_json(self, just_results=False)
def write_output_files(self, file_key: str = None, location: str = None) ‑> NoneType

Write out the file contents of the model run results.

Args

model_run_name : str
The name of the model run (optional).
file_key : str
The file key (optional).
location : str
The location to write to (optional).