Skip to content

Dfs3.read(area=...) is documented and accepted, but always raises #1048

Description

@ecomodeller

Dfs3.read takes an area argument, documents it as "Read only data within the specified rectangular area (x0, x1, y0, y1)", and then raises unconditionally:

d = mikeio.open("tests/testdata/dissolved_oxygen.dfs3")
d.read(area=(600000, 6150000, 610000, 6160000))
# NotImplementedError: area subsetting is not yet implemented for Dfs3

The parameter appears in the signature, in the docstring, and in the generated API reference, so it looks supported from every angle a user would check. Dfs2.read implements it, which makes the dfs3 signature look like a promise of parity.

This is the same shape of problem as #968 (isel(layer=...) exposed on FM 3D DataArrays where it can never work): an argument that exists only to reject you. Either implement it, or drop it from the signature and docstring so the gap is visible before runtime.

Area subsetting is arguably more valuable for dfs3 than for dfs2, since dfs3 files are larger and reading a sub-area is one of the few ways to avoid loading the whole thing. layers= already does this for the vertical direction.


Code sites:

  • src/mikeio/dfs/_dfs3.py (Dfs3.read)
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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions