Skip to content

feat(dfns): switch key sets on with when; one meaning for rules - #407

Merged
wpbonelli merged 1 commit into
MODFLOW-ORG:developfrom
wpbonelli:keyset-when
Nov 2, 2026
Merged

wpbonelli merged 1 commit into
MODFLOW-ORG:developfrom
wpbonelli:keyset-when

Conversation

@wpbonelli

@wpbonelli wpbonelli commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #406, #395. Allow a key set to specify when a component may assume a role.

# gwf-wel
[keys]
mover_provider = { path = "<=maxbound", when = "mover" }
bound = "<=maxbound"
  • mover roles (mover_provider, mover_receiver) get when = "mover"
  • validator checks that when names a keyword option, as it does for fields

Also, the spec previously gave rules two jobs: without a scope a rule picked the instance, with a scope it narrowed the target's values. Consolidate these into one meaning: a subset of the fk's target that the value must fall in (a view, in relational terms). A rule may stand in for a scope or may narrow a scoped target.

A key set may now take a `when`, as a field does (MODFLOW-ORG#395): the name of an
options keyword that switches the component's part in a role on. The mover
roles get `when = "mover"`, so a package without MOVER contributes no mover
keys and an fk naming it fails an ordinary key check. The spec now states
the MOVER condition in one place, the key sets, instead of as a rule.

The rule `mover_enabled` stays, for MVR's packages block, whose rows
needn't be named by any period row. It now means "plays a mover role",
defined by those key sets, rather than restating the option.

Also reword rules to have one meaning: a named subset of the fk's target
that the value must fall in (a view, in relational terms), which may
stand in for a scope or narrow a scoped target. The previous wording gave
rules two jobs depending on whether a scope was present.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wpbonelli wpbonelli added this to the 1.10.0 milestone Nov 2, 2026
@wpbonelli wpbonelli added the enhancement New feature or request label Nov 2, 2026
@wpbonelli
wpbonelli merged commit a146811 into MODFLOW-ORG:develop Nov 2, 2026
15 of 16 checks passed
@wpbonelli
wpbonelli deleted the keyset-when branch November 2, 2026 21:52
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