Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions flopy4/mf6/codec/writer/templates/macros.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

{% macro keystring(name, value) %}
{% for option in (value|data2keystring) -%}
{{ record("", option) }}
{% endfor %}
{{ record("", option) }}{% if not loop.last %}{{ "\n" }}{% endif %}
{%- endfor %}
{% endmacro %}

{% macro record(name, value) %}
Expand All @@ -37,26 +37,26 @@
{% endmacro %}

{% macro array(name, value, how="internal") %}
{{ name.upper() }}{% if "layered" in how %} LAYERED{% endif %}
{{ inset ~ name.upper() }}{% if "layered" in how %} LAYERED{% endif %}

{% if how == "constant" %}
CONSTANT {{ value.item() }}
CONSTANT {{ value.item() }}
{% elif how == "layered constant" %}
{% for layer in value -%}
CONSTANT {{ layer.item() }}
CONSTANT {{ layer.item() }}
{%- endfor %}
{% elif how == "internal" %}
INTERNAL
INTERNAL
{% for chunk in value|array_chunks -%}
{{ chunk|array2string }}
{{ (2 * inset) ~ chunk|array2string }}
{%- endfor %}
{% elif how == "external" %}
OPEN/CLOSE {{ value }}
OPEN/CLOSE {{ value }}
{% endif %}
{% endmacro %}

{% macro list(name, value) %}
{% for row in (value|data2list) %}
{{ inset ~ row|join(" ") }}
{% endfor %}
{{ inset ~ row|join(" ") }}{% if not loop.last %}{{ "\n" }}{% endif %}
{%- endfor %}
{% endmacro %}
4 changes: 3 additions & 1 deletion flopy4/mf6/gwf/oc.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
class Oc(Package):
@define(slots=False)
class Format:
fmt_kw: str = field(default="print_format")
columns: int = field(default=10)
width: int = field(default=11)
digits: int = field(default=4)
Expand Down Expand Up @@ -49,7 +50,8 @@ class Period:
converter=to_path,
default=None,
)
format: Optional[Format] = field(block="options", default=None, init=False)
# TODO: needs coverter and then rename?
head: Optional[Format] = field(block="options", default=None)
save_head: Optional[NDArray[np.object_]] = array(
object,
block="period",
Expand Down
1 change: 0 additions & 1 deletion flopy4/mf6/ims.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class Ims(Solution):
solution_package: ClassVar[Sln] = Sln(abbr="ims", pattern="*")
slntype: ClassVar[str] = "ims"

mxiter: Optional[int] = field(default=1)
print_option: Optional[str] = field(block="options", default=None)
complexity: str = field(block="options", default="simple")
csv_outer_output_file: Optional[Path] = field(default=None, block="options")
Expand Down
2 changes: 1 addition & 1 deletion test/test_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def test_gwf_chd01(function_tmpdir):
parent=gwf,
budget_file=f"{gwf_name}.cbc",
head_file=f"{gwf_name}.hds",
# COLUMNS 10 WIDTH 15 DIGITS 6 GENERAL
head="PRINT_FORMAT COLUMNS 10 WIDTH 15 DIGITS 6 GENERAL",
save_head=["last"],
# save_head={0: "last"},
save_budget=["last"],
Expand Down
Loading