Skip to content

Commit

Permalink
ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
wpbonelli committed Oct 11, 2024
1 parent 47488cc commit 0a24e4f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions flopy/mf6/utils/codegen/shim.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,12 +432,16 @@ def _attr(var: dict) -> Optional[str]:
VarKind.Union.value,
]:
if not var_block:
raise ValueError("Need block")
raise ValueError("Need block")

if var_ref:
if var_ref:
# if the variable is a subpackage reference, use the original key
# (which has been replaced already with the referenced variable)
args = [f"'{ctx_name.r}'", f"'{var_block}'", f"'{var_ref['key']}'"]
args = [
f"'{ctx_name.r}'",
f"'{var_block}'",
f"'{var_ref['key']}'",
]
if ctx_name.l is not None and ctx_name.l not in [
"sim",
"sln",
Expand All @@ -446,7 +450,7 @@ def _attr(var: dict) -> Optional[str]:
]:
args.insert(0, f"'{ctx_name.l}6'")
return f"{var_ref['key']} = ListTemplateGenerator(({', '.join(args)}))"

args = [f"'{ctx_name.r}'", f"'{var_block}'", f"'{var_name}'"]
if ctx_name.l is not None and ctx_name.l not in [
"sim",
Expand Down

0 comments on commit 0a24e4f

Please sign in to comment.