Skip to content

generate more packages - #392

Merged
wpbonelli merged 11 commits into
modflowpy:developfrom
wpbonelli:dis-codegen
Oct 3, 2026
Merged

wpbonelli merged 11 commits into
modflowpy:developfrom
wpbonelli:dis-codegen

Conversation

@wpbonelli

@wpbonelli wpbonelli commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #391. Generate more packages, pull in some devtools fixes, fix some issues

  • generate
    • gwf-gnc
    • utl-ts
    • gwf-maw
    • gwf-uzf
    • gwf-hfb
    • gwf-sfr
  • update devtools
  • size counted columns from their dims
    • GNC alphasj by numalphaj
    • TS values by len(time_series_names)
    • EVT segments by nseg-1
    • SFR ic by packagedata.ncon(ifno)
  • take period-list dims from the list's bound (HFB maxhfb, CSUB maxsig0)
  • signed index (SFR ic): store (reach, ±1) pairs, accept raw signed ints too
  • take advantage of DFN representation of cell ID
  • aux on layer- and grid-array packages is a dict keyed by auxiliary name
  • don't write empty optional blocks (SFR diversions etc., which MF6 rejects)
  • model name file LIST option was written as _LIST, fix it
  • OC HEAD PRINT_FORMAT overwrote HEAD FILEOUT, file records now only match rows with FILEIN/FILEOUT
  • OC/PRP STEPS was written as floats, now steps: tuple[int, ...]
  • match inner records without a keyword by their first tagged field (IMS INNER_RCLOSE, XMD)
  • warn on unknown blocks instead of dropping them silently

wpbonelli and others added 11 commits October 2, 2026 18:57
Generate GWF-GNC and add it to the Gwf model.

- a `node` field (a grid cell reference, e.g. GNC's cellidn) is generated
  as a cellid
- an inline array sized by a DIMENSIONS field (GNC's cellidsj and
  alphasj, by numalphaj) is a fixed-width tuple column with
  count=<dim>, read in place, so it need not be the last column; an
  array of node references is a tuple of cellids
- a row's cellid width, inferred from its length when there are no grid
  dims, accounts for several cellids per row

gnc.py is generated against a spec with cellidsj marked `node`, pending
the devtools change (modflow-devtools/gnc-cellid-node-refs.md).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- a dimension counting an array column (GNC's numalphaj) is set from the
  column's length unless given; a given value or differing row lengths
  that disagree are an error
- a count may be a dimension plus or minus a constant, so EVT's pxdp and
  petm are tuples of nseg-1 values (numbers or time series names), and
  nseg is derived from them; previously rows with nseg > 2 misparsed
- construct_item no longer puts an empty aux tuple into an omitted
  optional column before it (EVT's petm0)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…locks

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- emit/consume an item's union-arm keyword after its row-key (pk/fk)
  columns, not after every index column (SFR `ifno DIVERSION idv divflow`)
- read/write SFR's `NONE` cellid (unconnected reach) as cellid=None
- ignore tokens after a block header's index in the basic and typed
  grammars (MAW's legacy `begin period 1 steady-state`); typed
  block_index gets its own rule so its LALR state doesn't merge with
  record rows'
- drop strict xfails the aux/TAS period array work fixed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wpbonelli
wpbonelli marked this pull request as ready for review October 3, 2026 12:25
@wpbonelli
wpbonelli merged commit 116fa2b into modflowpy:develop Oct 3, 2026
16 checks passed
@wpbonelli
wpbonelli deleted the dis-codegen branch October 3, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant