Skip to content

feat(dfns): support tagged lists - #368

Merged
wpbonelli merged 2 commits into
MODFLOW-ORG:developfrom
wpbonelli:tagged-list
Sep 23, 2026
Merged

wpbonelli merged 2 commits into
MODFLOW-ORG:developfrom
wpbonelli:tagged-list

Conversation

@wpbonelli

@wpbonelli wpbonelli commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

MF6 may in some cases accept multiple instances of a variable in an input file, but the new spec/schema could not express this. For example, TS6/TAS6 FILEIN can appear multiple times.

Distinguish tagged from untagged lists: a list is tagged iff every line allowed by its item type begins with a keyword. This property is derived from the list item type rather than declared explicitly, and is true for

  1. records: when the record's first field is a tagged scalar/array, a record satisfying 1, or a union satisfying 2
  2. unions: when every arm of the union is a tagged scalar/array, or a record satisfying 1

In other words, a list is tagged if every line it allows begins with a keyword: starting from the item type, descend into the first field of each record and into each arm of each union; every path must end at a tagged scalar or array.

Represent ts_filerecord and tas_filerecord as tagged lists instead of standalone records.

Constraints previously applying to all lists now apply only to untagged lists: these must be last and alone in their block; a tagged list may sit anywhere in the block's tagged fields, provided no other field collides with its item keywords.

Applying the tagged/untagged classification to existing lists: PRT PRP's period block variable becomes a tagged list, and likewise for OC packages' period blocks, which have a similar structure. On the other hand, stress package period variables are untagged lists, the leading columns being cell ID.

Also regenerate schema.json, it was stale

MF6 accepts any number of TS6/TAS6 FILEIN lines in a package's options block, but the spec could only express a single optional record. Distinguish tagged from untagged lists: a list is tagged iff every row begins with a keyword, derived from its item rather than declared. Only untagged lists must be last and alone in their block; a tagged list may sit anywhere among the block's tagged fields, provided no other field begins with one of its row keywords. Migrate ts_filerecord and tas_filerecord to tagged lists via an explicit allowlist, since v1 has no attribute for this. Also regenerate schema.json, which was stale since MODFLOW-ORG#367.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wpbonelli wpbonelli added this to the 1.10.0 milestone Sep 23, 2026
@wpbonelli wpbonelli added the bug Something isn't working label Sep 23, 2026
@wpbonelli
wpbonelli marked this pull request as ready for review September 23, 2026 15:24
Whether a list is tagged is a property of its item type at definition time, not of the rows in any input file. Reword docs, comments and messages to match, and rename List.row_tags to List.item_tags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wpbonelli wpbonelli added enhancement New feature or request and removed bug Something isn't working labels Sep 23, 2026
@wpbonelli
wpbonelli merged commit f0261f5 into MODFLOW-ORG:develop Sep 23, 2026
21 of 23 checks passed
@wpbonelli
wpbonelli deleted the tagged-list branch September 23, 2026 15:51
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