Skip to content

Migration & Deprecations

This page lists deprecated public API symbols in HYDROLIB-core, the version in which they were deprecated, the version in which they will be removed, and the migration path for each one.

If you depend on a deprecated name, your code will keep working for the current release line but will emit a DeprecationWarning at runtime. We recommend migrating before the listed removal release.

How to surface deprecation warnings in your project

Python suppresses DeprecationWarning by default outside of test runs. To surface them in your own application or scripts:

import warnings


warnings.filterwarnings("default", category=DeprecationWarning,
                        module=r"hydrolib\..*")

Or run a one-off check with:

python -W default::DeprecationWarning your_script.py

To fail your test suite on any HYDROLIB-core deprecation, configure pytest:

# pyproject.toml or pytest.ini
[tool.pytest.ini_options]
filterwarnings = [
                 "error::DeprecationWarning:hydrolib.*",
]

Quick reference

Symbol Deprecated in Removal target Replacement
Meteo.forcingVariableName 1.1.0 2.0.0 Meteo.forcingvariablename
Meteo.extrapolationAllowed 1.1.0 2.0.0 Meteo.extrapolationallowed
Meteo.extrapolationSearchRadius 1.1.0 2.0.0 Meteo.extrapolationsearchradius
Meteo.averagingType 1.1.0 2.0.0 Meteo.averagingtype
Meteo.averagingNumMin 1.1.0 2.0.0 Meteo.averagingnummin
Meteo.averagingPercentile 1.1.0 2.0.0 Meteo.averagingpercentile
ProcessFluxIntegration after 1.5.0 2.0.0 none (always done by WAQ)

1.1.0

Meteo attribute names lowercased

The Python attribute names on hydrolib.core.dflowfm.ext.models.Meteo were inconsistent: most fields used lowercase identifiers (forcingfile, targetmaskfile, interpolationmethod, …) while six fields used camelCase. These six have been renamed to match the convention.

The on-disk INI key names (e.g. forcingVariableName = … in .ext files) are unchanged — only Python attribute access changes. Construction by keyword argument also keeps working with the camelCase form (it goes through the unchanged Pydantic alias).

Renamed attributes

Old (deprecated) New
forcingVariableName forcingvariablename
extrapolationAllowed extrapolationallowed
extrapolationSearchRadius extrapolationsearchradius
averagingType averagingtype
averagingNumMin averagingnummin
averagingPercentile averagingpercentile

Migration — attribute access

# Before
if meteo.extrapolationAllowed:
    radius = meteo.extrapolationSearchRadius
meteo.averagingType = 1

# After
if meteo.extrapolationallowed:
    radius = meteo.extrapolationsearchradius
meteo.averagingtype = 1

Migration — model_dump() output keys

If you call meteo.model_dump() without by_alias=True, the returned dict keys reflect the new lowercase attribute names:

# Before:                                After:
{"extrapolationAllowed": True, ...}
{"extrapolationallowed": True, ...}

If you need the on-disk INI key names, pass by_alias=True:

meteo.model_dump(by_alias=True)
# -> {"extrapolationAllowed": True, ...}

The library's own INI serializer always uses by_alias=True, so the contents of .ext files on disk are unaffected.

Not affected

  • Reading existing .ext files via ExtModel(filepath=...) — wire-format keys are unchanged and parsing is case-insensitive.
  • Writing .ext files via model.save(...) — output is byte-identical.
  • Constructing Meteo with keyword arguments using either the old or new name: both work via Pydantic alias resolution.
Meteo(quantity="rainfall",
      forcingfile=ForcingModel(),
      forcingfiletype=MeteoForcingFileType.uniform,
      extrapolationAllowed=True)        # still works, no warning

1.5.0

ProcessFluxIntegration enum deprecated, MDU keyword removed

The [Processes] ProcessFluxIntegration keyword is obsolete in D-Flow FM: process fluxes integration is always done by WAQ, and the kernel rejects the keyword. It was removed from the Processes model together with the other obsolete MDU keywords (issue #1189), so an MDU file that contains it no longer loads.

The enum ProcessFluxIntegration in hydrolib.core.dflowfm.mdu stays importable until 2.0.0. Importing it is silent; using it (ProcessFluxIntegration.WAQ, ProcessFluxIntegration(1), ProcessFluxIntegration["WAQ"], iterating it) emits a DeprecationWarning.

Migration

  • Remove ProcessFluxIntegration from your MDU files.
  • Remove uses of the enum and of FMModel.processes.processfluxintegration; there is no replacement.

Obsolete MDU keywords removed from the models

Keywords that are obsolete in D-Flow FM were removed from the FMModel sections (and from the Research* sections, where applicable) in issue #1189. The kernel rejects an MDU file that contains them, and FMModel now raises a ValidationError ("Unknown keywords are detected") when one is present. Remove them from your MDU files and use the replacement where there is one.

The list of deprecated and removed MDU keywords, with the keyword to use instead, is in the D-Flow FM User Manual, Appendix A (MDU file), section "Overview of deprecated and removed keywords" (table tab:oldkeys).