Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Issue #809 Update project dependencies #810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 2, 2024
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
1 change: 1 addition & 0 deletions examples/mf6/circle_partitioned.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
case the 3 submodels are roughly equal sized partitions that have the shape
of pie pieces.
"""

import matplotlib.pyplot as plt
from example_models import create_circle_simulation

Expand Down
1 change: 1 addition & 0 deletions examples/mf6/different_ways_to_regrid_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
regridding method for the horizontal conductivity field

"""

# %%
# We'll start with the usual imports. As this is an simple (synthetic)
# structured model, we can make due with few packages.
Expand Down
1 change: 1 addition & 0 deletions examples/mf6/ex01_twri.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* Visualize the results.

"""

# %%
# We'll start with the usual imports. As this is an simple (synthetic)
# structured model, we can make due with few packages.
Expand Down
1 change: 1 addition & 0 deletions examples/mf6/example_1d_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
shape of the front of the solute plume.

"""

# %%

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions examples/mf6/example_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
with it (such as regridding).

"""

import numpy as np
import scipy.ndimage
import xarray as xr
Expand Down
1 change: 1 addition & 0 deletions examples/mf6/lake.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* Visualize the results.

"""

# %%
# We'll start with the usual imports. As this is an simple (synthetic)
# structured model, we can make due with few packages.
Expand Down
1 change: 1 addition & 0 deletions examples/prepare/reproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
In this example we will see how to reproject vector and raster datasets.

"""

import matplotlib.pyplot as plt
import pyproj

Expand Down
1 change: 1 addition & 0 deletions examples/user-guide/01-raster-data.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
conveniences for such data, such as plotting or selecting. To demonstrate,
we'll get some sample data provided with the imod package.
"""

import xarray as xr

# %%
Expand Down
1 change: 1 addition & 0 deletions examples/user-guide/02-vector-data.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
DataFrame to store tabular data (the attribute table), and adds a geometry
column to store the geospatial coordinates.
"""

# %%
import geopandas as gpd
import numpy as np
Expand Down
1 change: 1 addition & 0 deletions examples/user-guide/05-unstructured-grids.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
2D), or 6 neighbors (in 3D).

"""

# %%


Expand Down
1 change: 1 addition & 0 deletions examples/user-guide/06-lazy-evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

We will explain these concepts with a number of examples.
"""

# %%
import dask.array
import numpy as np
Expand Down
1 change: 1 addition & 0 deletions imod/data/sample_data.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Functions to load sample data.
"""

import importlib
from pathlib import Path
from typing import Union
Expand Down
1 change: 1 addition & 0 deletions imod/formats/prj/disv_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Most of the functionality here attempts to replicate what iMOD does with
project files.
"""

import itertools
import pickle
from collections import Counter
Expand Down
1 change: 1 addition & 0 deletions imod/formats/prj/prj.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Utilities for parsing a project file.
"""

import shlex
from collections import defaultdict
from datetime import datetime
Expand Down
1 change: 1 addition & 0 deletions imod/mf6/adv.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Upstream weighting is a fast alternative, and TVD is a more expensive and more
robust alternative.
"""

from copy import deepcopy

from imod.mf6.package import Package
Expand Down
1 change: 0 additions & 1 deletion imod/mf6/interfaces/ipackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class IPackage(IPackageBase, metaclass=abc.ABCMeta):

"""
The base methods and attributes available in all packages
"""
Expand Down
1 change: 1 addition & 0 deletions imod/mf6/mf6_wel_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
GIS systems. The low-level classes contain a dataset based on cellid,
consisting of layer, row, and column, closely resembling input for Modflow6.
"""

from typing import Optional

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions imod/mf6/out/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def open_cbc(
(These could be implemented via Reader classes, but why bother with mutable
state or a class with exclusively staticmethods?)
"""

from typing import Any, Callable, Dict, Optional, Union

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions imod/mf6/out/cbc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Cell-by-cell flows
"""

import os
import struct
from collections import defaultdict
Expand Down
6 changes: 3 additions & 3 deletions imod/mf6/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,9 @@ def mask(self, domain: GridDataArray) -> Any:
if is_scalar(da.values[()]):
masked[var] = da.values[()] # For scalars, such as options
else:
masked[
var
] = da # For example for arrays with only a layer dimension
masked[var] = (
da # For example for arrays with only a layer dimension
)
else:
masked[var] = None

Expand Down
1 change: 1 addition & 0 deletions imod/mf6/validation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module contains specific validation utilities for Modflow 6.
"""

import numpy as np
import xarray as xr

Expand Down
12 changes: 6 additions & 6 deletions imod/msw/landuse.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ def __init__(
self.dataset["start_sprinkling_season"] = start_sprinkling_season
self.dataset["end_sprinkling_season"] = end_sprinkling_season
self.dataset["interception_option"] = interception_option
self.dataset[
"interception_capacity_per_LAI_Rutter"
] = interception_capacity_per_LAI
self.dataset[
"interception_capacity_per_LAI_VonHoyningen"
] = interception_capacity_per_LAI
self.dataset["interception_capacity_per_LAI_Rutter"] = (
interception_capacity_per_LAI
)
self.dataset["interception_capacity_per_LAI_VonHoyningen"] = (
interception_capacity_per_LAI
)
self.dataset["interception_intercept"] = interception_intercept

self._pkgcheck()
Expand Down
6 changes: 3 additions & 3 deletions imod/msw/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ def __init__(self, unsaturated_database):
super().__init__()

self.simulation_settings = copy(DEFAULT_SETTINGS)
self.simulation_settings[
"unsa_svat_path"
] = self._render_unsaturated_database_path(unsaturated_database)
self.simulation_settings["unsa_svat_path"] = (
self._render_unsaturated_database_path(unsaturated_database)
)

def _render_unsaturated_database_path(self, unsaturated_database):
# Force to Path object
Expand Down
1 change: 1 addition & 0 deletions imod/prepare/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
xarray.DataArrays, as well as aggregation methods operating on weights and
values.
"""

import cftime
import numba
import numpy as np
Expand Down
1 change: 1 addition & 0 deletions imod/prepare/interpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
* nd_interp: collects the weights, reshapes the array so iter_interp will take
it.
"""

import numba
import numpy as np

Expand Down
1 change: 1 addition & 0 deletions imod/prepare/pcg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

This is a translation of the fortran77 modflow2000 pcg2.f module.
"""

import numba


Expand Down
1 change: 1 addition & 0 deletions imod/prepare/regrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
values from the source array (src), and pass it on to the aggregation method.
The single aggregated value is then filled into the destination array (dst).
"""

from collections import namedtuple

import dask
Expand Down
1 change: 1 addition & 0 deletions imod/prepare/wells.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Assign wells to layers.
"""

from typing import Optional, Union

import numpy as np
Expand Down
6 changes: 4 additions & 2 deletions imod/tests/fixtures/mf6_small_models_fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ def grid_data_unstructured_layered(


def _make_model(
grid_data_function: Callable[[type, Union[int, float], float], xr.DataArray]
| Callable[[type, Union[int, float], float], xu.UgridDataArray],
grid_data_function: (
Callable[[type, Union[int, float], float], xr.DataArray]
| Callable[[type, Union[int, float], float], xu.UgridDataArray]
),
cellsize: float,
) -> imod.mf6.GroundwaterFlowModel:
gwf_model = imod.mf6.GroundwaterFlowModel()
Expand Down
6 changes: 3 additions & 3 deletions imod/tests/test_mf6/test_mf6_hfb.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,9 @@ def test_to_mf6_remove_invalid_edges(
):
# Arrange.
idomain, top, bottom = parameterizable_basic_dis
idomain.loc[
{"x": idomain.coords["x"][-1]}
] = inactivity_marker # make cells inactive
idomain.loc[{"x": idomain.coords["x"][-1]}] = (
inactivity_marker # make cells inactive
)
k = ones_like(top)

barrier_y = [0.0, 2.0]
Expand Down
6 changes: 3 additions & 3 deletions imod/tests/test_mf6/test_mf6_uzf_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ def uzf_model():
)
uds["extinction_depth"] = ones_shape_time * -10.0

uds[
"simulate_groundwater_seepage"
] = False # Model doesn't converge if set to True....
uds["simulate_groundwater_seepage"] = (
False # Model doesn't converge if set to True....
)

gwf_model["uzf"] = imod.mf6.UnsaturatedZoneFlow(**uds)

Expand Down
1 change: 1 addition & 0 deletions imod/tests/test_mf6/test_package_sanity.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* Tests whether writing and saving results in the same object state (as Python
None is turned into numpy NaN).
"""

import inspect

import numpy as np
Expand Down
Loading