Skip to content

v0.19.0

Latest

Choose a tag to compare

@github-actions github-actions released this 01 Jun 16:43

scmdata v0.19.0 (2026-06-01)

Features

  • Added {func}scmdata.groupby.RunGroupby.apply_parallel to perform parallelise large groupby operations (#262)

Bug Fixes

  • Restored compatibility with pandas 3.0 and xarray 2025+ by patching four places where the older APIs are no longer accepted:

    • RunGroupBy.__init__ previously called numpy.issubdtype(col.dtype, numpy.number) to detect numeric meta columns, which raises TypeError on pandas.StringDtype (the new default for inferred string columns). Routed through pandas.api.types.is_numeric_dtype.
    • _xarray._many_to_one ended with Series[0] positional indexing, which pandas 3 has removed. Replaced with .iloc[0].
    • ScmRun.convert_unit, _binary_op and _unary_op wrote results via self._df.values[:] = .... pandas 3 makes DataFrame.values return a read-only array, so the in-place write raises ValueError. Switched to self._df.iloc[:, :] = ...; the binary/unary op sites additionally cast their right-hand side to float so that comparison ops (lt, eq, ne, ...) which return bool arrays continue to land as float64 in the underlying numeric block, preserving the prior silent-cast behaviour.
    • _read_nc passed use_cftime=True to xarray.load_dataset, which xarray 2025+ deprecates in favour of decode_times=xr.coders.CFDatetimeCoder(use_cftime=True). The deprecation otherwise fires a FutureWarning on every ScmRun.from_nc() call. Routes through the new API where available and falls back to the bare kwarg on xarray older than 2024.09.

    The previously-failing ScmRun.groupby, ScmRun.to_xarray, ScmRun.convert_unit, ScmRun.to_nc / ScmRun.from_nc, and the arithmetic and comparison operators on ScmRun now all run on both pandas 2 and pandas 3.

    (#321)