Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Bug] - PRJ PERIODS with year 0000 cannot be parsed

Open Beginner friendly
#1,940 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
data

Research direction

The failure happens in the PRJ PERIODS parser before the _process_time(time, yearfirst=False).replace(year=1899) call, so start with _process_time and the code that reads PERIODS entries from the PRJ file. Reproduce with a PERIODS line using year 0000 and confirm the ValueError from datetime. Done means that input parses and produces a year-1899 timestamp, with a test covering it.

Written by the indexing model from the issue text.

Description

bug

The iMOD PRJ parser cannot read valid iMOD PERIODS entries using year 0000.

This raises:

ValueError: year must be in 1..9999, not 0

The parser does replaces period years with 1899 using:

_process_time(time, yearfirst=False).replace(year=1899)

However, parsing fails before this replacement is reached.

Expected behavior:

PERIODS entries with year 0000 should be accepted and normalized to year 1899

Dominant language
Python
Stars
41
Forks
11
Avg merge
2d 23h
Merged PRs (30d)
13

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

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 Deltares/imod-python

All issues in Deltares/imod-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.