feat(dfns): support tagged lists - #368
Merged
Merged
Conversation
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>
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>
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.
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 FILEINcan 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
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_filerecordandtas_filerecordas 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