[FEATURE] - Add a 3d GEN writer

オープン
#1,965 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
57/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
41
フォーク
12
平均マージ
2日 8時間
マージ済み PR(30日)
13

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Deltares/imod-python のほかの issue

Deltares/imod-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。