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

Adaptive Time Stepping package error loading from toml

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

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

故障出在 imod/mf6/simulation.py 的 Modflow6Simulation.from_file 中,其中 TOML 节键会在 classes 映射中查找,而 AdaptiveTimeStepping 缺失。通过转储一个包含 ats 包的模型并用 from_file 重新加载来复现,然后检查其他包是如何注册并从 TOML 重建的。完成意味着包含 [AdaptiveTimeStepping] 的 TOML 能成功加载,且相关的仿真测试仍然通过。

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

描述

bug Deltares

Bug description
imod.mf6.Modflow6Simulation.from_file(model_toml) fails when an ats (adaptive time stepping) package is present in the model, that is written to netcdf files using model.dump('folder/to/dump')

Steps to reproduce
Error message:

KeyError Traceback (most recent call last)
Cell In[4], line 1
----> 1 model = imod.mf6.Modflow6Simulation.from_file(model_toml)

File c:\model_builder.pixi\envs\default\Lib\site-packages\imod\logging\logging_decorators.py:32, in standard_log_decorator..decorator..wrapper(*args, **kwargs)
29 logger.log(loglevel=start_level, message=start_message, additional_depth=2)
31 # run function
---> 32 return_value = fun(*args, **kwargs)
33 end_time = time()
35 # anounce end of function

File c:\model_builder.pixi\envs\default\Lib\site-packages\imod\mf6\simulation.py:1126, in Modflow6Simulation.from_file(toml_path)
1124 for key, entry in toml_content.items():
1125 if key not in ["gwtgwf_exchanges", "split_exchanges"]:
-> 1126 item_cls = classes[key]
1127 for name, filename in entry.items():
1128 path = toml_path.parent / filename

KeyError: 'AdaptiveTimeStepping'

Desktop (please complete the following information):

  • iMOD Python Version '1.0.0.post1'

Additional context
In this case I want to load an existing model, use the spatial information and make additional changes for scenario development. This is now not automatically possible, as I can not simply load the data using the toml. The manual workaround is to remove the [AdaptiveTimeStepping] section from the toml manually, so i can at least load the other packages.

主要语言
Python
星标
41
派生
10
平均合并
2 天 23 小时
30 天内合并 PR
15

环境准备

  • 没有 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 摘要。