|
14 | 14 |
|
15 | 15 | def spatial_overview(
|
16 | 16 | obs: Observation | Iterable[Observation],
|
17 |
| - mod: Optional[DfsuModelResult | GeometryFM2D] = None, |
| 17 | + mod: Optional[ |
| 18 | + DfsuModelResult |
| 19 | + | GeometryFM2D |
| 20 | + | Iterable[DfsuModelResult] |
| 21 | + | Iterable[GeometryFM2D] |
| 22 | + ] = None, |
18 | 23 | ax=None,
|
19 | 24 | figsize: Optional[Tuple] = None,
|
20 | 25 | title: Optional[str] = None,
|
@@ -57,20 +62,21 @@ def spatial_overview(
|
57 | 62 | ```
|
58 | 63 | """
|
59 | 64 | obs = [] if obs is None else list(obs) if isinstance(obs, Iterable) else [obs] # type: ignore
|
| 65 | + mods = [] if mod is None else list(mod) if isinstance(mod, Iterable) else [mod] # type: ignore |
60 | 66 |
|
61 | 67 | ax = _get_ax(ax=ax, figsize=figsize)
|
62 | 68 |
|
63 | 69 | # TODO: support Gridded ModelResults
|
64 |
| - if mod is not None: |
65 |
| - if isinstance(mod, (PointModelResult, TrackModelResult)): |
| 70 | + for m in mods: |
| 71 | + if isinstance(m, (PointModelResult, TrackModelResult)): |
66 | 72 | raise ValueError(
|
67 |
| - f"Model type {type(mod)} not supported. Only DfsuModelResult and mikeio.GeometryFM supported!" |
| 73 | + f"Model type {type(m)} not supported. Only DfsuModelResult and mikeio.GeometryFM supported!" |
68 | 74 | )
|
69 |
| - if hasattr(mod, "data") and hasattr(mod.data, "geometry"): |
| 75 | + if hasattr(m, "data") and hasattr(m.data, "geometry"): |
70 | 76 | # mod_name = m.name # TODO: better support for multiple models
|
71 |
| - g = mod.data.geometry |
| 77 | + g = m.data.geometry |
72 | 78 | else:
|
73 |
| - g = mod |
| 79 | + g = m |
74 | 80 |
|
75 | 81 | # TODO this is not supported for all model types
|
76 | 82 | g.plot.outline(ax=ax) # type: ignore
|
|
0 commit comments