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
3 changes: 2 additions & 1 deletion docs/api/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ Fixed
- Improved performance of :class:`imod.mf6.Modflow6Simulation.split` for
structured models, as unnecessary masking is avoided.
- Fixed warning thrown by type dispatcher about ``~GeoDataFrameType``

- Fixed bug where variables in a package with only a ``"layer"`` coordinate
could not be regridded or masked.

Changed
~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion imod/common/utilities/mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def mask_package(package: IPackage, mask: GridDataArray) -> IPackage:


def _skip_dataarray(da: GridDataArray) -> bool:
if len(da.dims) == 0 or set(da.coords).issubset(["layer"]):
if len(da.dims) == 0 or set(da.dims).issubset(["layer", "time"]):
return True

if is_scalar(da):
Expand Down
32 changes: 32 additions & 0 deletions imod/tests/test_mf6/test_mf6_qgis_export.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""
QGIS user acceptance test, these are pytest-marked with 'qgis_export'.

"""

from pathlib import Path

import pytest
import xugrid as xu

import imod


@pytest.mark.qgis_export
def test_mf6_qgis_export__structured(tmp_path):
mf6_sim = imod.data.hondsrug_simulation(tmp_path / "unzipped")

path_dumped = Path(tmp_path) / "hondsrug_MDAL"
mf6_sim.dump(path_dumped, mdal_compliant=True, crs="EPSG:28992")
print(f"Dumped to: {path_dumped}")


@pytest.mark.qgis_export
def test_mf6_qgis_export__unstructured(tmp_path):
mf6_sim = imod.data.hondsrug_simulation(tmp_path / "unzipped")
idomain = mf6_sim["GWF"]["dis"]["idomain"]
grid = xu.UgridDataArray.from_structured2d(idomain)

mf6_sim_unstructured = mf6_sim.regrid_like("unstructured_model", grid)
path_dumped = Path(tmp_path) / "hondsrug_MDAL"
mf6_sim_unstructured.dump(path_dumped, mdal_compliant=True, crs="EPSG:28992")
print(f"Dumped to: {path_dumped}")
10 changes: 8 additions & 2 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ unittests_njit = { cmd = [
"NUMBA_DISABLE_JIT=1",
"pytest",
"-n", "auto",
"-m", "not example and not user_acceptance and not unittest_jit",
"-m", "not example and not user_acceptance and not unittest_jit and not qgis_export",
"--cache-clear",
"--verbose",
"--junitxml=unittest_report.xml",
Expand All @@ -57,7 +57,6 @@ user_acceptance = { cmd = [
"--verbose",
"--junitxml=user_acceptance_report.xml",
], depends-on = ["install"], cwd = "imod/tests", env = { IMOD_DATA_DIR = ".imod_data" } }

examples = { cmd = [
"pytest",
"-n", "auto",
Expand All @@ -66,6 +65,13 @@ examples = { cmd = [
"--verbose",
"--junitxml=examples_report.xml",
], depends-on = ["install"], cwd = "imod/tests", env = { IMOD_DATA_DIR = ".imod_data" } }
qgis_export ={ cmd = [
"pytest", "-s",
"-m", "qgis_export",
"--cache-clear",
"--verbose",
"--junitxml=qgis_export_report.xml",
], depends-on = ["install"], cwd = "imod/tests", env = { IMOD_DATA_DIR = ".imod_data" } }

[dependencies]
affine = "*"
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ ignore_missing_imports = true
markers = [
"example: marks test as example (deselect with '-m \"not example\"')",
"user_acceptance: marks user acceptance tests (deselect with '-m \"not user_acceptance\"')",
"unittest_jit: marks unit tests that should be jitted (deselect with '-m \"not unittest_jit\"')"
"unittest_jit: marks unit tests that should be jitted (deselect with '-m \"not unittest_jit\"')",
"qgis_export: marks tests that export to QGIS (deselect with '-m \"not qgis_export\"')",
]

[tool.hatch.version]
Expand Down