-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #965 # Description Adds a function to import an npf package from an imod5 project file. Adds tests. # Checklist - [x] Links to correct issue - [ ] Update changelog, if changes affect users - [x] PR title starts with ``Issue #nr``, e.g. ``Issue #737`` - [x] Unit tests were added - [ ] **If feature added**: Added/extended example --------- Co-authored-by: Joeri van Engelen <[email protected]>
- Loading branch information
1 parent
72515e6
commit 721d5c3
Showing
7 changed files
with
206 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import pytest | ||
import xarray as xr | ||
|
||
import imod | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def imod5_dataset(): | ||
tmp_path = imod.util.temporary_directory() | ||
data = imod.data.imod5_projectfile_data(tmp_path) | ||
_load_imod5_data_in_memory(data[0]) | ||
return data[0] | ||
|
||
|
||
def _load_imod5_data_in_memory(imod5_data): | ||
"""For debugging purposes, load everything in memory""" | ||
for pkg in imod5_data.values(): | ||
for vardata in pkg.values(): | ||
if isinstance(vardata, xr.DataArray): | ||
vardata.load() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters