[FEATURE] - Add a 3d GEN writer

Ouverte
#1,965 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 2 jours

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
57/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
python
Domaine
backend

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
Python
Étoiles
41
Forks
12
Merge moyen
2 j 8 h
PR mergées (30 j)
13

Préparer son environnement

  • Aucun Dockerfile ni fichier Docker Compose
  • Propose un modèle de pull request
  • Aucun guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de Deltares/imod-python

Toutes les issues de Deltares/imod-python

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.