Skip to content

feat(dfns): standardize cell id representation - #373

Merged
wpbonelli merged 2 commits into
MODFLOW-ORG:developfrom
wpbonelli:cellid-node-arrays
Oct 2, 2026
Merged

wpbonelli merged 2 commits into
MODFLOW-ORG:developfrom
wpbonelli:cellid-node-arrays

Conversation

@wpbonelli

Copy link
Copy Markdown
Member

Cell IDS had 2 encodings, an array of shape ncelldim (stress packages, HFB) or just an integer (exchanges, GNC). Standardize on the array encoding for all cell ID fields

Array(dtype="integer", shape=["ncelldim", ...], index=True, cellid=True)
  • ncelldim must be the first axis
  • further axes count the number of consecutive cell IDs to appear
    • e.g. cellidsj is ["ncelldim", "numalphaj"]
  • Array.cellid requires integer dtype, index, a leading ncelldim, and to be in a list

wpbonelli and others added 2 commits October 2, 2026 13:22
Every cellid column is now Array(dtype="integer", shape=["ncelldim", ...],
index=True, node=True): the first (fastest-varying) axis is one cellid's
components, any further axes count cellids. This replaces the two prior
encodings (bare ncelldim-shaped arrays, and Integer(node=True), whose type
misstated its width) with one, and fixes GNC's cellidsj, which was read as
plain integers on DIS/DISV grids.

- schema: remove Integer.node; add Array.node, requiring integer dtype,
  index, a leading ncelldim, and a list item context. A node array's
  ncelldim isn't resolved in the component's scope, since it depends on
  the referenced grid (exchanges see neither model's dims).
- migration: rewrite allowlisted integer cellid columns (exchange
  cellidm1/2, GNC cellidn/cellidm) as ncelldim arrays, prefix GNC cellidsj
  with ncelldim, and mark every ncelldim-led integer array in a list item.
- docs: Array node section, shape axis order, multi-dim inline arrays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The attribute marks an ncelldim-wide cellid (layer/row/column, etc.), which
is what MF6 calls a cellid; "node" in MF6 means a single node number. The
new name matches MF6's docs, the DFN column names, and flopy4's usage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wpbonelli wpbonelli added this to the 1.10.0 milestone Oct 2, 2026
@wpbonelli wpbonelli added the enhancement New feature or request label Oct 2, 2026
@wpbonelli
wpbonelli marked this pull request as ready for review October 2, 2026 20:40
@wpbonelli
wpbonelli merged commit 4e77cff into MODFLOW-ORG:develop Oct 2, 2026
15 checks passed
@wpbonelli
wpbonelli deleted the cellid-node-arrays branch October 2, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant