ModelLink¶
Classes¶
Utilities¶
-
prism.modellink.
convert_data
(model_data)[source]¶ Converts the provided model_data into a full data dict, taking into account all formatting options, and returns it.
This function can be used externally to check how the provided model_data would be interpreted when provided to the
ModelLink
subclass. Its output can be used for the ‘model_data’ input argument.Parameters: model_data (array_like, dict or str) – Anything that can be converted to a dict that provides model data information. Returns: data_dict (dict) – Dict with the provided model_data converted to its full format.
-
prism.modellink.
convert_parameters
(model_parameters)[source]¶ Converts the provided model_parameters into a full parameters dict, taking into account all formatting options, and returns it.
This function can be used externally to check how the provided model_parameters would be interpreted when provided to the
ModelLink
subclass. Its output can be used for the ‘model_parameters’ input argument.Parameters: model_parameters (array_like, dict or str) – Anything that can be converted to a dict that provides model parameters information. Returns: par_dict (dict) – Dict with the provided model_parameters converted to its full format.
-
prism.modellink.
test_subclass
(subclass, *args, **kwargs)[source]¶ Tests a provided
ModelLink
subclass by initializing it with the given args and kwargs and checking if all required methods can be properly called.This function needs to be called by all MPI ranks.
Parameters: Returns: modellink_obj (
ModelLink
object) – Instance of the provided subclass if all tests pass successfully. Specific exceptions are raised if a test fails.Note
Depending on the complexity of the model wrapped in the given subclass, this function may take a while to execute.