Skip to content

Commit 7c9d3d7

Browse files
authored
little steps (#150)
little format fixes
1 parent 6bdd3a5 commit 7c9d3d7

File tree

7 files changed

+47
-73
lines changed

7 files changed

+47
-73
lines changed

.vscode/settings.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"editor.formatOnSave": true,
33
"files.insertFinalNewline": true,
44
"python.testing.pytestArgs": [
5-
"test"
5+
"test",
6+
"-s"
67
],
78
"python.testing.unittestEnabled": false,
89
"python.testing.pytestEnabled": true,
@@ -22,5 +23,5 @@
2223
".pixi": true,
2324
".ruff_cache": true,
2425
".pytest_cache": true
25-
}
26+
},
2627
}

flopy4/mf6/templates/blocks.jinja

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{% import 'macros.jinja' as macros with context %}
22
{% for block_name, block_ in (dfn|blocks).items() %}
3-
BEGIN {{ block_name }}
3+
BEGIN {{ block_name.upper() }}
44
{% for field in block_.values() -%}
55
{{ macros.field(field) }}
66
{%- endfor %}
7-
END {{ block_name }}
7+
END {{ block_name.upper() }}
88

99
{% endfor %}

flopy4/mf6/templates/macros.jinja

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
{% endmacro %}
1313

1414
{% macro scalar(field) %}
15+
{% set type = field|field_type %}
1516
{% set value = field|field_value %}
16-
{% if value is not none %}{{ field.name }} {{ value }}{% endif %}
17+
{% if value is not none %}{{ field.name.upper() }}{% if type != 'keyword' %} {{ value }}{% endif %}{% endif %}
1718
{% endmacro %}
1819

1920
{% macro keystring(field) %}
@@ -24,7 +25,7 @@
2425

2526
{% macro record(field) %}
2627
{% for item in field.children.values() -%}
27-
{% if item.tagged %}{{ item.name }} {% endif %}{{ field(item) }}
28+
{% if item.tagged %}{{ item.name.upper() }} {% endif %}{{ field(item) }}
2829
{%- endfor %}
2930
{% endmacro %}
3031

@@ -38,7 +39,7 @@
3839
{% endmacro %}
3940

4041
{% macro array(name, value, how="internal") %}
41-
{{ name }}{% if "layered" in how %} LAYERED{% endif %}
42+
{{ name.upper() }}{% if "layered" in how %} LAYERED{% endif %}
4243

4344
{% if how == "constant" %}
4445
CONSTANT {{ value.item() }}

pixi.lock

Lines changed: 32 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/test_codec.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,10 @@ def test_dumps_ic():
1414
export_array_netcdf=True,
1515
)
1616

17-
# TODO figure out how to adapt simulation_data
18-
# and get this working, then compare results?
19-
# old_gwf = Flopy3Model(model=gwf)
20-
# old_ic = ModflowGwfic(
21-
# old_gwf,
22-
# save_flows=True,
23-
# save_initial_conditions=True,
24-
# export_array_ascii=True,
25-
# export_array_netcdf=True,
26-
# )
27-
2817
result = dumps(ic)
18+
print()
2919
print(result)
20+
print()
3021
assert result
3122

3223

test/test_component.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -274,15 +274,7 @@ def test_ims_dfn():
274274

275275
def test_write_ascii(tmp_path):
276276
time = ModelTime(perlen=[1.0], nstp=[1], tsmult=[1.0])
277-
grid = StructuredGrid(nlay=1, nrow=10, ncol=10)
278277
sim = Simulation(tdis=time, workspace=tmp_path)
279-
# TODO fix errors
280-
# gwf = Gwf(parent=sim, dis=grid)
281-
# ic = Ic(parent=gwf)
282-
# oc = Oc(parent=gwf)
283-
# npf = Npf(parent=gwf)
284-
# chd = Chd(parent=gwf, head={"*": {(0, 0, 0): 1.0, (0, 9, 9): 0.0}})
285-
286278
sim.write()
287279

288280
files = list(Path(tmp_path).glob("*"))

uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)