Skip to content

Need shareable MOUSE and Water Hammer fixtures to support those formats in Network #686

Description

@jpalm3r

Network now has one constructor per modelling product, and each one exists only where a committed test fixture backs it:

Constructor Extensions Fixture
Network.from_mike .res1d, .res11 tests/testdata/network.res1d, network_cali.res11
Network.from_epanet .res tests/testdata/epanet.res

Two of the formats mikeio1d can open are refused purely because we have no file to test them with:

  • MOUSE.prf, .crf, .xrf
  • Water Hammer.whr

Neither has a result file in this repo or in mikeio1d's testdata, so there is no way to check whether the existing loader produces a correct network for them. Both currently raise:

NotImplementedError: Cannot read '.prf' files. MOUSE results are not supported
yet: modelskill has no test fixture for this format, so support cannot be
verified. Please open an issue if you need it.

What would help: a small, redistributable result file for either format — ideally from a public or synthetic model rather than a client project. Once one lands in tests/testdata, adding the constructor is a docstring plus one delegating call to Network._from_mikeio1d, and the extension moves from _UNSUPPORTED_EXTENSIONS to its own set in src/modelskill/network.py.

One caveat worth recording for whoever picks this up: for MOUSE extensions mikeio1d calls ResultData.Load() and rebuilds res1d.network on the first data read (result_reader.py:141-146), with a comment noting that existing network references are invalidated. Network._load_res1d_network captures ResultReach objects and then triggers that read, so MOUSE support may need the load forced up front. That cannot be confirmed without a fixture.

Not fixture problems

Two other formats are refused for a different reason, and no fixture will change that:

  • SWMM (.out) — mikeio1d cannot resolve reach start/end nodes. ResultReachCreator._get_start_node indexes result_data.Nodes[reach.StartNodeIndex] and raises ArgumentOutOfRangeException; mikeio1d's own test_swmm_network.py never touches reach connectivity.
  • .resxResultReach.start_node/end_node return None by design.

Both are upstream gaps rather than modelskill bugs. tests/testdata/swmm.out and epanet.resx are committed and asserted against, so if a future mikeio1d starts exposing connectivity for either, those tests fail and tell us a constructor is now possible.

An EPANET file from a confidential project was also used during development to sanity-check from_epanet at scale (~8000 reaches); it cannot be committed, hence the smaller public fixture.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions