[FEATURE] - Add a 3d GEN writer

Đang mở
#1,965 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
57/100
Loại issue
Tính năng
Độ rõ ràng
Khá 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

Start by reading the existing imod.formats.gen reader and gen.write implementation to see how ASCII and binary formats are handled. The issue gives no test file or exact writer API, so first locate the GEN format tests and check how they represent 3D vertices. Done means gen.write can produce 3D ASCII GEN output with Z values on each vertex.

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

Mô tả

backwards_compatibility enhancement

See https://github.com/Deltares/iMOD-Suite-transition-regional-models/pull/36

Summary

imod.formats.gen can read 3D ASCII GEN files (x, y, z per vertex) but cannot write them. gen.write only writes the binary format, from 2D coordinates. Downstream code that needs 3D GEN output has to write the text itself. I'd like iMOD Python to own this, so reading and writing of GEN files live in one place.

Use Case

The iMOD-Suite regional-model conversion CLI (Deltares/iMOD-Suite-transition-regional-models) has a GENSNAPTOGRID function. It snaps GEN lines to the cell edges of a grid and, with I3D=1, writes every snapped edge as a closed vertical wall polygon with a Z value on each vertex. iMOD5's GENSNAPTOGRID with I3D=1 does the same. The CLI currently has a private _write_gen_ascii_3d helper for this, marked as a TODO to move to iMOD Python.

Currently, write only writes the binary Fortran-record format. It writes the bounds and xy as float records, so Z is never written.

Follow-up in iMOD-Suite-transition-regional-models

Once this is merged, delete _write_gen_ascii_3d from src/snapping.py. snap_gen_file_to_grid then calls the new iMOD Python writer for I3D=1. The CLI tests that compare the 3D output with iMOD5 stay as they are.

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

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.