Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Adaptive Time Stepping package error loading from toml

Đang mở Phù hợp với người mới
#1,950 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend

Hướng nghiên cứu

Lỗi nằm trong imod/mf6/simulation.py trong Modflow6Simulation.from_file, nơi khóa mục TOML được tra trong một ánh xạ classes và AdaptiveTimeStepping bị thiếu. Tái hiện bằng cách dump một mô hình có chứa gói ats rồi tải lại nó bằng from_file, sau đó kiểm tra cách các gói khác được đăng ký và tái dựng từ TOML. Hoàn thành nghĩa là một TOML chứa [AdaptiveTimeStepping] tải thành công và các bài kiểm thử mô phỏng liên quan vẫn chạy qua.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
41
Fork
10
Merge trung bình
2 ngày 23 giờ
Pull request đã merge (30 ngày)
15

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Deltares/imod-python

Tất cả issue của Deltares/imod-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.