Repository navigation
feat(dfns): improve child bindings - #379
Merged
Merged
Conversation
Add File.component (a selector over component names, types and subtypes, resolved among the owning component's children) and File.component_ref (a sibling naming the target's ftype token), plus File.mode_keyword for name-file entries, which have no FILEIN. Selectors and parents share one vocabulary: add admits() and covering_selector(), make Dfns.children() use admits() so list and type/subtype parents work, and add Dfns.ftype()/ftype_family() to map ftype tokens to components, array-based variants included. A concrete package parent (utl-tvk's gwf-npf) now resolves to that package's model for model-scoped dims. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Link subpackage file records from the legacy `# flopy subpackage` keys, plus a small table for what those miss (sfr/lak tab6, ssm spc6), and turn name-file filename columns into linked Files. Check every `# mf6 subpackage` line is covered. Derive each linked component's parent from the components linking it, as the simplest covering selector, replacing infer_parent's guess: e.g. utl-ts/obs/ncf/spc become `package`, utl-tvk `gwf-npf`, utl-ats `sim-tdis`, gwf-gnc `[exg-gwfgwf, gwf-nam]`. This needs the whole corpus, so migrate.py and Dfns.load now go through migrate_corpus(). Also make sim-nam's tdis6 required: mf6 fails without it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Name-file links resolve a token like DIS6 or GWF6-GWF6 to a component. That mapping was a naming-convention guess in the schema (Dfns.ftype); make it data instead: ComponentBase.ftype, set by the migration, with array-based variants sharing their base's token as mf6 does (InputLoadType.f90). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sibling it names holds an ftype token, not a component name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
utl-spc, utl-spca, utl-tas and utl-ncf derived 'package' as their parent, though only a few packages link them. Name those packages instead, checked to admit every linker. Note in the spec that links are exact and a derived parent may admit more. 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.
An MF6 simulation has a tree of input files. The simulation namefile lists models, exchanges and solutions. Each model namefile lists packages. Packages may point to utilities, such as time series or observations. Until now the DFN spec described a file, and the schema's corresponding
Filefield, as just a path, with nothing saying what it points to.Make the target explicit so the spec can fully express how the simulation's components bind to one another. Allow a
Filefield to name thecomponentit corresponds to. For example,ts6_filenameingwf-chdnamesutl-ts. Most of these point to a single type, with namefile entries being an exception: a model'sfnamecolumn can point to any package, and theftypecolumn next to it picks which. Add aFile.component_ftypeattribute too, to name another field playing this role. And addftypeto all components. These are unique per package from a hydrologic perspective, but not per DFN (variants such asgwf-rchaandgwf-rchhave the sameftype)