Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭 适合新手
#1,940 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
data

调研方向

故障发生在 PRJ PERIODS 解析器中,早于 _process_time(time, yearfirst=False).replace(year=1899) 的调用,因此请从 _process_time 以及读取 PRJ 文件中 PERIODS 条目的代码开始。使用年份为 0000 的 PERIODS 行进行复现,并确认 datetime 抛出的 ValueError。当该输入能够成功解析并生成年份为 1899 的时间戳,且有测试覆盖这一情况时,即为完成。

由索引模型根据 Issue 内容生成。

描述

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

主要语言
Python
星标
41
派生
11
平均合并
3 天 3 小时
30 天内合并 PR
12

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Deltares/imod-python 的其他 Issue

查看 Deltares/imod-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。