Skip to content

[get_paths] Silent fallback to altered mockup data when NHFLODATA_LOCATION is unset #68

Description

@bdestombe

Severity: major (a full model run can complete entirely on fabricated data with no signal)

Where: src/nhflodata/get_paths.py:96get_abs_data_path(..., location="get_from_env").

Problem. With location="get_from_env" and NHFLODATA_LOCATION unset or empty, get_abs_data_path silently resolves every dataset to the packaged mockup tree, whose data is by its own documentation "altered". There is no warning-level signal, so a model script (e.g. 09pwnmodel2) runs to completion built entirely from mockup data. NHFLODATA_LOCATION was found unset in a normal dev environment, so this is easy to hit.

Suggested fix. Emit a logger.warning (or raise, behind an opt-out) in get_abs_data_path when location=="get_from_env" falls back to the mockup tree; and/or recommend a production guard in consuming scripts (assert "mockup" not in data_path.parts).


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.

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