Repository navigation
conditional fields - #473
Merged
Merged
Conversation
EVT's petm0 is read only with SURF_RATE_SPECIFIED, and then always. The row layout took it if a token was left for it, so with BOUNDNAMES set a row leaving out its boundname lost its petm0 to the boundname. Codegen now marks petm0 with its option, the row context carries the options a package has set, and the layout reads a gated column by its option. A Python row with petm0 sets the option, as one with a boundname sets BOUNDNAMES. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MF6 tries an observation's id as a cell before a boundname, so an id naming boundname 5 is node 5 on a DISU grid, or an error on another. Writing a package now warns if one of its observations does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pins MODFLOW-ORG/modflow-devtools#395 (9a1662ef), which adds the when attribute codegen will read in place of the _OPTION_COLUMNS table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drops codegen's _OPTION_COLUMNS table for the when attribute modflow-devtools now migrates (EVT's petm0, by surf_rate_specified). Regenerating gives no diff. Boundname keeps its own handling for now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Renames the option field metadata to when, after the DFN attribute, and stores optional unchanged: EVT's petm0 is now when=surf_rate_specified, not optional. Whether a column may be missing from a row is optional or when, worked out in one place (item._may_be_absent), and codegen gives it a None default on the same test. A column whose option is on is required unless it's optional, rather than always, so boundname can carry when=boundnames later and still be left out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The DFN's when isn't only for list columns, and "options" meant three things: option_columns is now conditional_fields, RowContext.options (the options that are on) is RowContext.enabled, _layout's inner options() (the ways a slot can take values) is fits(), and by_option is conditional. 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>
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.
Some fields are valid only when another option is set, e.g. EVT's
petm0withSURF_RATE_SPECIFIED. The DFNs now have awhenattribute (MODFLOW-ORG/modflow-devtools#395) indicating this. Use itBoundnames move onto the same mechanism after #470