feat(dfns): support fill-forward blocks - #367
Merged
wpbonelli merged 4 commits intoSep 22, 2026
Merged
Conversation
Block.repeats (header is not None) says a block can repeat, but not what a missing occurrence means. MF6 has two distinct answers: `period` blocks fill forward (a missing period reuses the prior one's data), while other repeating-header blocks (utl-tas's `time`, solutiongroup, continuous) don't. Nothing in the schema captured this, forcing flopy4's ingress converter to hardcode the distinction by block name instead of deriving it from the DFN. Add `BlockHeader.fill_forward: bool`, nested under `Block.header` so it's only representable when the block actually has a header. No v1 tag exists for this, so it's hardcoded by block name in migrate_to_v2_0_0_dev2.py, same discipline as Block.write_if_empty.
Fill-forward semantics require a sequential ordinal index; a Double or Record header has no well-defined "prior occurrence" to reuse. Validated at construction so the invariant can't drift silently.
period's iper and solutiongroup's group_num are both documented in MF6 source as monotonically increasing across occurrences regardless of fill_forward -- only the meaning of a gap in that sequence varies.
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.
Capture the "fill forward" concept for integer-indexed repeating (e.g. period) blocks. Factor out a
BlockHeadertype withfieldandfill_forwardattributes whereBlock.headerwas previously anInputFielddirectly