Skip to content

fix(dfns): remove fkeys/ref; add DfnSpec.dump/s()#305

Merged
wpbonelli merged 1 commit intoMODFLOW-ORG:developfrom
wpbonelli:dfnspec
Apr 20, 2026
Merged

fix(dfns): remove fkeys/ref; add DfnSpec.dump/s()#305
wpbonelli merged 1 commit intoMODFLOW-ORG:developfrom
wpbonelli:dfnspec

Conversation

@wpbonelli
Copy link
Copy Markdown
Member

Add DfnSpec.dump() and DfnSpec.dumps() methods to serialize the full spec to a single hierarchical TOML blob. This standalone representation might be more convenient than a directory of files for some use cases. E.g., MF6 could emit the entire spec as a TOML blob (MODFLOW-ORG/modflow6#2777) for flopy to generate an MF6 module from, e.g.

mf6 --spec | flopy.mf6.utils.generate_classes -

Also remove the fkeys attribute/concept (field-level foreign keys encoding subpackage attachment) and Ref dataclass. Represent "floating" subpackage relationships (i.e., a subpackage may be attached to one of several possible parent components) instead via the existing Dfn.subcomponents field, which lists the string names of component types a given component can accept as subpackages. This is simpler and more consistent with how fixed-parent hierarchy is already handled via Dfn.children. Also normalize subcomponent abbreviations to lowercase to match component name conventions elsewhere.

@wpbonelli wpbonelli marked this pull request as ready for review April 20, 2026 11:42
@wpbonelli wpbonelli merged commit 5ff8d7f into MODFLOW-ORG:develop Apr 20, 2026
43 of 45 checks passed
@wpbonelli wpbonelli deleted the dfnspec branch April 20, 2026 11:48
@github-actions github-actions Bot mentioned this pull request Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant