Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
wpbonelli committed Oct 15, 2024
1 parent 452d974 commit f0caa86
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 1 addition & 2 deletions flopy/mf6/utils/codegen/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ def make_targets(dfn: Dfn, outdir: Path, verbose: bool = False):
for context in Context.from_dfn(dfn):
target = outdir / context.name.target
with open(target, "w") as f:
source = _TEMPLATE.render(**context.render())
f.write(source)
f.write(_TEMPLATE.render(**context.render()))
if verbose:
print(f"Wrote {target}")

Expand Down
7 changes: 7 additions & 0 deletions flopy/mf6/utils/codegen/ref.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ def from_dfn(cls, dfn: Dfn) -> Optional["Ref"]:
Try to load a reference from the definition.
Returns `None` if the definition cannot be
referenced by other contexts.
"""

# TODO: all this won't be necessary once we
# structure DFN format; we can then support
# subpackage references directly instead of
# by making assumptions about `dfn.meta`

if not dfn.meta or "dfn" not in dfn.meta:
return None

Expand Down

0 comments on commit f0caa86

Please sign in to comment.