Document (or close) five known validation gaps in DfsuBuilder and DfsuFile

Open
#50 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
documentation

Research direction

Start by reading the five TODO locations in mikecore/DfsuBuilder.py and mikecore/DfsuFile.py, including the layered-file Validate logic and spectral dispatch. For each gap, determine from the surrounding behavior whether it is an intentional limitation or needs a separate issue with a failing case; done means the decision and rationale are recorded, or follow-up issues are opened.

Written by the indexing model from the issue text.

Description

Five TODOs mark gaps that are already handled conservatively — they raise clearly or skip a check rather than producing wrong output. Collecting them so the limits are visible without reading the source; none is a silent bug.

DfsuBuilder.SetZUnit, mikecore/DfsuBuilder.py:201# TODO: Fix! above:

if (zUnit != eumUnit.eumUmeter
    and zUnit != eumUnit.eumUfeet
    and zUnit != eumUnit.eumUUnitUndefined):
  raise Exception("Currently only meter and feet unit is supported")

Any other Z unit is rejected outright. Whether more units should be accepted, and what "Fix!" meant, is unrecorded.

mikecore/DfsuFile.py:224# TODO Validate data. Data written to a dfsu is not checked for length or type against the item it belongs to; a mismatch surfaces further down rather than at the call.

mikecore/DfsuBuilder.py:310-311 — in the layered-file validation:

# TODO: Need to check that node coordinates are also on top of each other?
# TODO: Need to check that the 2D elements are defined counter-clockwise

Validate checks that layered elements sit on top of each other by connectivity and that layer counts match the sigma-layer count, but does not check coordinates or element orientation. A file violating either passes validation.

mikecore/DfsuBuilder.py:341# TODO do we need to check frequency or directions?; spectral file types get no validation beyond the type dispatch itself.

Each is one of: accept as designed and document it, or promote to its own issue with a case that goes wrong. The value here is that the answer is written down somewhere other than a code comment.

Dominant language
Python
Stars
5
Forks
1
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DHI/mikecore-python

All issues in DHI/mikecore-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.