diff --git a/cf_xarray/accessor.py b/cf_xarray/accessor.py index 08bc28ea..f747ba44 100644 --- a/cf_xarray/accessor.py +++ b/cf_xarray/accessor.py @@ -2727,7 +2727,9 @@ def grid_mapping_names(self) -> dict[str, list[str]]: results[v].append(k) return results - def decode_vertical_coords(self, *, outnames=None, prefix=None): + def decode_vertical_coords( + self, *, outnames: dict[str, str] | None = None, prefix: str | None = None + ) -> None: """ Decode parameterized vertical coordinates in place. @@ -2765,6 +2767,7 @@ def decode_vertical_coords(self, *, outnames=None, prefix=None): allterms = self.formula_terms for dim in allterms: + dim = cast(str, dim) if prefix is None: assert outnames is not None, ( "if prefix is None, outnames must be provided" diff --git a/cf_xarray/parametric.py b/cf_xarray/parametric.py index ca8a85ae..bd155329 100644 --- a/cf_xarray/parametric.py +++ b/cf_xarray/parametric.py @@ -782,7 +782,7 @@ def from_terms(cls, terms: dict): return cls(**get_terms(terms, "sigma", "depth", "z1", "z2", "a", "href", "k_c")) -TRANSFORM_FROM_STDNAME = { +TRANSFORM_FROM_STDNAME: dict[str, type[ParametricVerticalCoordinate]] = { "atmosphere_ln_pressure_coordinate": AtmosphereLnPressure, "atmosphere_sigma_coordinate": AtmosphereSigma, "atmosphere_hybrid_sigma_pressure_coordinate": AtmosphereHybridSigmaPressure,