Module nom_client.results.model_run
Class to hold the results of a model run.
Classes
class ModelRun
-
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]
-
Get the model result by its name.
Args
result_name
:str
- The name of the model result.
Returns
Union[NumericModelResult, ModelResult]
- The model result with the specified name.
Raises
ValueError
- If no result is found with the given name.
def get_model_result_by_quantity(self, quantity: str, **qualifiers) ‑> Dict[str, Union[NumericModelResult, nom_client.results.model_result.ModelResult]]
-
Get model results by quantity and optional qualifiers.
Parameters: - quantity (str): The quantity of the results to retrieve. - qualifiers (**kwargs): Optional qualifiers to further filter the results.
Returns: - dict: A dictionary containing the model results that match the specified quantity and qualifiers. The keys are the result names, and the values are either NumericModelResult or Model *Result objects.
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
-
Check if the model result with the specified name exists.
:param result_name: The name of the model result to check. :type result_name: str :return: True if the model result with the specified name exists, False otherwise. :rtype: bool
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).