Skip to content

v1.5.0

Latest

Choose a tag to compare

@fschuch fschuch released this 08 Oct 20:36
e88418e

What's Changed

The on-demand loader prm.dataset gets a lazy, Dask-backed successor built on xarray-binfile 0.3, and starts its deprecation. Existing code keeps working, with a warning.

Added

  • Lazy, Dask-backed IO on xarray-binfile; deprecate prm.dataset by @fschuch in #142

    • prm.open_dataset() opens every snapshot of a simulation as one lazy xarray.Dataset. Nothing is read until values are needed, one Dask task per file by default, with velocity components stacked on i (u from ux, uy, uz) and scalar fractions on n (phi from phi1, phi2, ...). stack_names reassembles user-defined fields too, for example {"i": {"u", "vort"}}; stack=False` returns the variables as on disk.
    • prm.write_dataset() writes arrays and datasets back to raw binaries with the familiar file_name / file_prefix rules. Any array carrying i or n is split into one file per component, whatever its name; t gives one file per snapshot. Writes are atomic per file and computed one file at a time.
    • Xcompact3dConvention (xcompact3d_toolbox.binfile): the description of the files (Fortran byte order, naming, t = step * dt * ioutput, static fields, sub-folders declared per case with folders=), reusable with xarray.open_mfdataset and .binary_engine.to_file directly. The dtype is chosen per call; param["mytype"] is only the default.
    • engine="xcompact3d" xarray backend: xr.open_mfdataset("case/data/*.bin", engine="xcompact3d", prm=prm). Without prm=, the single *.i3d or *.prm next to the data folder is loaded automatically.
    • prm.default_data_path, and an explicit data_path argument on init_epsi, init_dataset and gene_epsi_3d, which now write through the new API.
    • Documentation: a migration guide mapping every prm.dataset call to its replacement, a "Lazy loading with xarray-binfile" section in the IO tutorial, and API reference pages for the new modules.

Deprecated

  • prm.dataset emits a FutureWarning and will be removed in 2.0. The lazy API is independent of it: configure one or the other, never both. write_xdmf and load_wind_turbine_data stay on prm.dataset until they get a new home.

Changed

  • xarray-binfile 0.3 is a required dependency.
  • Output names written by the new API are letters, digits and underscores, optionally under sub-folders; the separator, counter and extension come from the convention, so file_prefix="w3-mean" is rejected with a clear message (the old writer accepted it).
  • Sandbox inflow planes (bxx1, byphi1, ...) are written by the new API but never listed by open_dataset; read them with xr.open_dataset(path, engine="xcompact3d", prm=prm, drop_coords=...).

Internals

  • chore(deps): bump the actions group with 2 updates by @dependabot[bot] in #131
  • chore(deps): bump actions/setup-python from 6.2.0 to 6.3.0 in the actions group by @dependabot[bot] in #134
  • chore(deps): bump the actions group across 1 directory with 5 updates by @dependabot[bot] in #140

Other Changes

Full Changelog: v1.4.0...v1.5.0