Skip to content

Release 3.3.0

Choose a tag to compare

@ecomodeller ecomodeller released this 10 Sep 08:42
ca9d723

What's new in v3.3.0

New features

  • Global options (#1039). mikeio.set_options() / mikeio.get_options(), also usable as a context manager like xarray.set_options. display_max_items controls how many item names a repr lists (None for all), so a dfs0 with 60 items no longer prints just number of items: 60. show_progress is now the single switch for progress bars, and covers writing as well.
  • dfs2 custom blocks (#1007). Dataset.custom_blocks exposes the named metadata arrays in the dfs header as a dict[str, np.ndarray], and to_dfs writes them back. This is where MIKE 21 keeps the land value (M21_Misc[3]); previously a read/write round-trip dropped it, so MIKE Zero greyed the land value out and .m21fm setups rejected the bathymetry.
  • ~ in file names is expanded (#1035), on read and write, as pandas and xarray do. ds.to_dfs("~/out.dfs0") used to create a directory literally named ~ without complaint.
  • Point selection on rotated Grid2D (#960). contains() handles rotated grids, and Dfs2.read() takes x/y, so extracting a single point from a large rotated grid no longer requires reading the whole array.
  • Writing to a path that cannot be created raises OSError instead of segfaulting the interpreter (#1056).

Breaking changes

  • The old progress-bar switches — the generic.show_progress module global and the show_progress class attribute on the readers — are removed in favour of set_options(show_progress=True). Neither was documented or tested. The default is now off, so generic functions no longer draw a bar unasked.
  • Dependency floors raised to the SPEC 0 24-month window (#1062): numpy ≥2.1, pandas ≥2.2, scipy ≥1.14, matplotlib ≥3.9, xarray ≥2024.9.

Documentation

Every public class, method and function now has a docstring, enforced by a test. New user guide pages for dfs3 and spectral dfsu, and a snow cover example for dfs2.

Full changelog: v3.2.0...v3.3.0