Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9ea9075
Optimize modelsplitter
Manangka Oct 13, 2025
07cad1a
Remove old slice_model method
Manangka Oct 14, 2025
0b631fa
Clean up modelsplitter
Manangka Oct 14, 2025
29b6f8d
Refactor modelsplitter
Manangka Oct 14, 2025
5457c49
Add documentation to the split method. More cleaning up
Manangka Oct 14, 2025
6b71831
Fix incorrect use of item()
Manangka Oct 14, 2025
f72c774
Directly call any() on the dask array
Manangka Oct 14, 2025
c201314
Fix regrid error due to use of wrong interface
Manangka Oct 14, 2025
f19553c
Rvert to earlier more efficient evaluation of has_overlap. Optimize r…
Manangka Oct 15, 2025
9a99506
Revert chunk optimization when opening zarr or nc files. Its not genr…
Manangka Oct 15, 2025
372c1f7
Merge branch 'master' into model_splitter_optimization
Manangka Oct 15, 2025
8567903
Apply review comment
Manangka Oct 16, 2025
cbe5624
Fix incorrect order of removing non-spatial dims
Manangka Oct 16, 2025
f37972f
Fix lint error
Manangka Oct 16, 2025
a32e989
Refactor updating of th buy and ssm package after splitting. Refactor…
Manangka Oct 17, 2025
04f746e
Add comments to the ModelSplitter class
Manangka Oct 17, 2025
67ca384
Merge branch 'master' into model_splitter_optimization
Manangka Oct 20, 2025
e86f735
Move logic to test whether to skip a package into its own method. Do …
JoerivanEngelen Oct 28, 2025
1967f2d
Rename to update_dependent_packages
JoerivanEngelen Oct 28, 2025
c265e41
Reflow paragraphs to 80 characters.
JoerivanEngelen Oct 28, 2025
dd47d59
Change hardcoded reference to "index" to call to .is_empty()
JoerivanEngelen Oct 28, 2025
0273210
Add trim_time_dimension logic to ModelSplitter
JoerivanEngelen Oct 28, 2025
5afc773
format
JoerivanEngelen Oct 28, 2025
7f87bf6
Fix mypy errors
JoerivanEngelen Oct 28, 2025
037bd18
revert toml and lock file
JoerivanEngelen Oct 28, 2025
d5129f7
Merge branch 'master' into model_splitter_optimization
JoerivanEngelen Oct 28, 2025
86fd4a4
Update changelog
JoerivanEngelen Oct 28, 2025
6df0093
Reduce cognitive load a bit
JoerivanEngelen Oct 29, 2025
59157e0
Merge branch 'master' into model_splitter_optimization
JoerivanEngelen Oct 29, 2025
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
7 changes: 7 additions & 0 deletions docs/api/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ The format is based on `Keep a Changelog`_, and this project adheres to
[Unreleased]
------------

Fixed
~~~~~

- Improved performance of :meth:`imod.mf6.Modflow6Simulation.split` for large
models loaded lazily into memory. Reduced a splitting operation of 2 hours to
a few minutes for a test case.

Added
~~~~~

Expand Down
22 changes: 22 additions & 0 deletions imod/common/interfaces/iagnosticpackage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from abc import abstractmethod

from imod.common.interfaces.ipackagebase import IPackageBase
from imod.typing import GridDataArray


class IAgnosticPackage(IPackageBase):
"""
Interface for packages for which the data is defined independent of the domain definition.
"""

@abstractmethod
def to_mf6_pkg(
self,
idomain: GridDataArray,
top: GridDataArray,
bottom: GridDataArray,
k: GridDataArray,
validate: bool = False,
strict_validation: bool = True,
) -> IPackageBase:
raise NotImplementedError
4 changes: 2 additions & 2 deletions imod/common/interfaces/ilinedatapackage.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from abc import abstractmethod
from typing import TYPE_CHECKING

from imod.common.interfaces.ipackagebase import IPackageBase
from imod.common.interfaces.iagnosticpackage import IAgnosticPackage

if TYPE_CHECKING:
import geopandas as gpd


class ILineDataPackage(IPackageBase):
class ILineDataPackage(IAgnosticPackage):
"""
Interface for packages for which the data is defined by lines independent of the domain definition.
"""
Expand Down
5 changes: 5 additions & 0 deletions imod/common/interfaces/ipackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,8 @@ def _is_regridding_supported(self) -> bool:
@abstractmethod
def _is_grid_agnostic_package(self) -> bool:
raise NotImplementedError

@property
@abc.abstractmethod
def pkg_id(self) -> str:
raise NotImplementedError
4 changes: 2 additions & 2 deletions imod/common/interfaces/ipointdatapackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import numpy as np
from numpy.typing import NDArray

from imod.common.interfaces.ipackagebase import IPackageBase
from imod.common.interfaces.iagnosticpackage import IAgnosticPackage


class IPointDataPackage(IPackageBase):
class IPointDataPackage(IAgnosticPackage):
"""
Interface for packages for which the data is defined by x and y coordinates independent of the domain definition.
"""
Expand Down
6 changes: 3 additions & 3 deletions imod/mf6/hfb.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ def to_mf6_pkg(
bottom: GridDataArray,
k: GridDataArray,
validate=True,
strict_hfb_validation=True,
strict_validation=True,
) -> Mf6HorizontalFlowBarrier:
"""
Write package to Modflow 6 package.
Expand All @@ -734,7 +734,7 @@ def to_mf6_pkg(
Grid with hydraulic conductivities.
validate: bool
Validate HorizontalFlowBarrier upon calling this method.
strict_hfb_validation: bool
strict_validation: bool
Turn on strict horizontal flow barrier validation.

Returns
Expand All @@ -743,7 +743,7 @@ def to_mf6_pkg(
Low level representation of the HFB package as MODFLOW 6 expects it.
"""
validation_context = ValidationSettings(
validate=validate, strict_hfb_validation=strict_hfb_validation
validate=validate, strict_hfb_validation=strict_validation
)

return self._to_mf6_pkg(idomain, top, bottom, k, validation_context)
Expand Down
Loading