Repository navigation
import generated mf6 module lazily - #445
Merged
Merged
Conversation
flopy4.mf6 loads its generated components on first use, so sync and status run when they're broken or out of date. Codegen checks for existing modules by file instead of importing them. With that, sync removes generated modules the new DFNs don't cover instead of keeping them. 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.
import the generated modules only on first use. this prevents the installation from getting into a catch 22 state where the sync command, which imports the top-level mf6 module, can't be used to fix broken modules because of broken modules.
modules may be broken for one of two reasons
moving the sync CLI command to a higher-level module would be one workaround, and may make sense at some point for other reasons, but it wouldn't really solve the problem, programmatic imports would still fail.
also, delete stale modules, i.e. generated modules the new DFNs don't cover
really we should verify generated modules aren't broken (can be imported) when we generate them. do that in a followup PR.