model_result
model_result(data, *, aux_items=None, gtype=None, **kwargs)A factory function for creating an appropriate object based on the data input.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| data | DataInputType | The data to be used for creating the ModelResult object. | required |
| aux_items | Optional[list[int | str]] | Auxiliary items, by default None | None |
| gtype | Optional[Literal['point', 'track', 'unstructured', 'grid']] | The geometry type of the data. If not specified, it will be guessed from the data. | None |
| **kwargs | Any | Additional keyword arguments to be passed to the ModelResult constructor. | {} |
Examples
>>> import modelskill as ms
>>> ms.model_result("Oresund2D.dfsu", item=0)
<DfsuModelResult> 'Oresund2D'
>>> ms.model_result("ERA5_DutchCoast.nc", item="swh", name="ERA5")
<GridModelResult> 'ERA5'