Deltares / Deltares/imod-python

Projectfile: Improve error message when number of stresses doesn't match number of data entries

Open
#1,077 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
41
Forks
12
Avg merge
21h 8m
Merged PRs (30d)
1

Description

In the header of each 'package' in the PRJ file there is a number, referring to the total number of stresses (incl steady state) that follows. If the number is larger than the following data blocks an error is thrown:
"list index out of range
failed to parse date time for line 517 with content []
Error occurred for keyword: (drn)"

However, this error thrown might not be clear. At lease not for us. It took us some time to find out. The project file looked good at line 517.
Positive: the keyword (e.g. drn) is given and also the prj file line number. But the text was not clear for us.

is it possible to make the error more self-explanatory

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.

Research direction

Start with the PRJ parser's package-header handling and reproduce a file where the declared stress count exceeds the following data blocks. Compare the resulting message with the package keyword, such as drn, and the reported line; done when the error clearly explains the count mismatch rather than only reporting an index or date-time failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.