Repository navigation
refactor(dfns): introduce cell ID type - #394
Merged
Merged
Conversation
A cellid was an integer array whose first axis was `ncelldim`, its
components, with any further axes counting cellids. That put a property of
the elements into the array's shape: consumers had to strip `ncelldim` to
find what counts the values, and to special-case a single cellid, which
has no counting axis and so looked self-sizing.
Now a single cellid is a scalar `CellID` field (type "cellid"), and several
are an `Array` with dtype "cellid", shaped only by what counts them (GNC's
`cellidsj` is `["numalphaj"]`). `ncelldim` leaves every shape: a cellid's
width is its grid's. Which grid is `model` ("1"/"2", or None for the
component's own), replacing `cellid=True/"1"/"2"`. A cellid is always
1-based, so it has no `index`. A cellid array rejects `index`, `fk`,
`time_series`, `layered` and `netcdf`, and `model`/`allow_zero` are
rejected on any other dtype.
New `allow_zero`: the cellid may refer to no cell, given as zeros. MF6
allows it for SFR packagedata `cellid` (an unconnected reach) and GNC
`cellidsj` (a dummy contributing cell); the migration sets it from an
audited allowlist, since v1 says so only in prose.
Rendered DFN text is unchanged (`<cellid(ncelldim)>`,
`<cellidsj(ncelldim, numalphaj)>`); checked for all 146 components. The
dev3 schema changes in place, as for MODFLOW-ORG#385.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CellIDa first class field type instead of anncelldiminteger arraymodel("1"/"2"/None) attribute to replacecellid=True/"1"/"2"attributeallow_zeroattribute for e.g. SFR packagedatacellidand GNCcellidsjBefore:
After: