scmdata v0.19.0 (2026-06-01)
Features
- Added {func}
scmdata.groupby.RunGroupby.apply_parallelto 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 callednumpy.issubdtype(col.dtype, numpy.number)to detect numeric meta columns, which raisesTypeErroronpandas.StringDtype(the new default for inferred string columns). Routed throughpandas.api.types.is_numeric_dtype._xarray._many_to_oneended withSeries[0]positional indexing, which pandas 3 has removed. Replaced with.iloc[0].ScmRun.convert_unit,_binary_opand_unary_opwrote results viaself._df.values[:] = .... pandas 3 makesDataFrame.valuesreturn a read-only array, so the in-place write raisesValueError. Switched toself._df.iloc[:, :] = ...; the binary/unary op sites additionally cast their right-hand side tofloatso that comparison ops (lt,eq,ne, ...) which returnboolarrays continue to land asfloat64in the underlying numeric block, preserving the prior silent-cast behaviour._read_ncpasseduse_cftime=Truetoxarray.load_dataset, which xarray 2025+ deprecates in favour ofdecode_times=xr.coders.CFDatetimeCoder(use_cftime=True). The deprecation otherwise fires aFutureWarningon everyScmRun.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 onScmRunnow all run on both pandas 2 and pandas 3.(#321)