Required
name| Type: | str |
| Description: | Name of the model. |
class StructuredModel(salvus.opt.models.base_model.BaseModel):
def __init__(
self,
name: str,
model: str | pathlib.Path | xr.Dataset,
fields: list[str],
): ...| Type: | str |
| Description: | Name of the model. |
| Type: | str | pathlib.Path | xr.Dataset |
| Description: | xarray DataSet. |
| Type: | list[str] |
| Description: | Names of the elemental fields to use. |
xr.Dataset)-The model as its actual representation.str)-Model name.ModelStatus)-Model status to keep track of whether the model has been modified.def from_disk(parent_folder: pathlib.Path, d: dict) -> StructuredModel: ...| Type: | pathlib.Path |
| Description: | Path where the model is stored. |
| Type: | dict |
| Description: | Dictionary containing meta information of the model. |
def from_json(d: dict) -> Self: ...| Type: | dict |
| Description: | Dictionary containing meta information of the model. |
def compute_inf_norm(self) -> float: ...def compute_norm(self) -> float: ...def copy(self, name: str) -> StructuredModel: ...| Type: | str |
| Description: | Name of the new (copied) model. |
def dot(self, other: StructuredModel) -> float: ...| Type: | StructuredModel |
| Description: | The other model. |
def max(self, other: StructuredModel) -> StructuredModel: ...| Type: | StructuredModel |
| Description: | Model to compare with. |
def min(self, other: StructuredModel) -> StructuredModel: ...| Type: | StructuredModel |
| Description: | Model to compare with. |
def to_disk(self, parent_folder: pathlib.Path | str) -> dict: ...| Type: | pathlib.Path | str |
| Description: | Path to store the model. |
def to_json(
self,
external_file_hash: types = None,
timer: types = None,
log_to_logger: bool = False,
comm: types = None,
) -> builtins.dict: ...| Type: | types |
| Default value: | None |
| Description: | Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file. |
| Type: | types |
| Default value: | None |
| Description: | Execution timer. |
| Type: | bool |
| Default value: | False |
| Description: | Log timings to the logger. |
| Type: | types |
| Default value: | None |
| Description: | MPI communicator, if any. |