Skip to content

[get_paths] Missing dataset path only logs a warning; failure surfaces as a distant FileNotFoundError #70

Description

@bdestombe

Severity: minor (diagnosability)

Where: src/nhflodata/get_paths.py:109.

Problem. When NHFLODATA_LOCATION is set but the resolved versioned folder is absent (e.g. the local data folder still holds bodemlagen_pwn_2024/v1.0.0 while registry 'latest' is v2.0.0), get_abs_data_path merely logs a warning and returns the nonexistent Path. The consuming script then runs expensive REGIS/AHN downloads and grid refinement before crashing deep inside a reader, far from the actual cause.

Suggested fix. Add a strict/required flag (default True for location 'local'/'get_from_env' with the env var set) that raises FileNotFoundError in get_abs_data_path itself, naming the dataset, resolved version, and NHFLODATA_LOCATION.


From a systematic review of modelscripts/09pwnmodel2/01_pwnmodel2.py and its dependency stack (nhflotools, nhflodata, nlmod), July 2026. Every finding was traced through the actual code and adversarially verified before filing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions