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
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"editor.formatOnSave": true,
"files.insertFinalNewline": true,
"python.testing.pytestArgs": [
"test"
"test",
"-s"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
Expand All @@ -22,5 +23,5 @@
".pixi": true,
".ruff_cache": true,
".pytest_cache": true
}
},
}
4 changes: 2 additions & 2 deletions flopy4/mf6/templates/blocks.jinja
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% import 'macros.jinja' as macros with context %}
{% for block_name, block_ in (dfn|blocks).items() %}
BEGIN {{ block_name }}
BEGIN {{ block_name.upper() }}
{% for field in block_.values() -%}
{{ macros.field(field) }}
{%- endfor %}
END {{ block_name }}
END {{ block_name.upper() }}

{% endfor %}
7 changes: 4 additions & 3 deletions flopy4/mf6/templates/macros.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
{% endmacro %}

{% macro scalar(field) %}
{% set type = field|field_type %}
{% set value = field|field_value %}
{% if value is not none %}{{ field.name }} {{ value }}{% endif %}
{% if value is not none %}{{ field.name.upper() }}{% if type != 'keyword' %} {{ value }}{% endif %}{% endif %}
{% endmacro %}

{% macro keystring(field) %}
Expand All @@ -24,7 +25,7 @@

{% macro record(field) %}
{% for item in field.children.values() -%}
{% if item.tagged %}{{ item.name }} {% endif %}{{ field(item) }}
{% if item.tagged %}{{ item.name.upper() }} {% endif %}{{ field(item) }}
{%- endfor %}
{% endmacro %}

Expand All @@ -38,7 +39,7 @@
{% endmacro %}

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

{% if how == "constant" %}
CONSTANT {{ value.item() }}
Expand Down
75 changes: 32 additions & 43 deletions pixi.lock

Large diffs are not rendered by default.

13 changes: 2 additions & 11 deletions test/test_codec.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,10 @@ def test_dumps_ic():
export_array_netcdf=True,
)

# TODO figure out how to adapt simulation_data
# and get this working, then compare results?
# old_gwf = Flopy3Model(model=gwf)
# old_ic = ModflowGwfic(
# old_gwf,
# save_flows=True,
# save_initial_conditions=True,
# export_array_ascii=True,
# export_array_netcdf=True,
# )

result = dumps(ic)
print()
print(result)
print()
assert result


Expand Down
8 changes: 0 additions & 8 deletions test/test_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,15 +274,7 @@ def test_ims_dfn():

def test_write_ascii(tmp_path):
time = ModelTime(perlen=[1.0], nstp=[1], tsmult=[1.0])
grid = StructuredGrid(nlay=1, nrow=10, ncol=10)
sim = Simulation(tdis=time, workspace=tmp_path)
# TODO fix errors
# gwf = Gwf(parent=sim, dis=grid)
# ic = Ic(parent=gwf)
# oc = Oc(parent=gwf)
# npf = Npf(parent=gwf)
# chd = Chd(parent=gwf, head={"*": {(0, 0, 0): 1.0, (0, 9, 9): 0.0}})

sim.write()

files = list(Path(tmp_path).glob("*"))
Expand Down
8 changes: 4 additions & 4 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading