Skip to content

Commit

Permalink
Cast to geodataframe to work around mypy error.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoerivanEngelen committed Nov 13, 2024
1 parent 2da131c commit cd2da26
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pre-processing/primod/driver_coupling/ribamod.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import abc
from pathlib import Path
from typing import Any
from typing import Any, cast

import imod
import numpy as np
Expand Down Expand Up @@ -162,11 +162,11 @@ def _write_exchange(
)
# in active coupling, check subgrid levels versus modflow bottom elevation
if isinstance(self, RibaModActiveDriverCoupling):
# Cast to geodataframe for mypy
subgrid_df = cast(gpd.GeoDataFrame, ribasim_model.basin.subgrid.df)
# check on the bottom elevation and ribasim minimal subgrid level
minimum_subgrid_level = (
ribasim_model.basin.subgrid.df.groupby("subgrid_id")
.min()["subgrid_level"]
.to_numpy()
subgrid_df.groupby("subgrid_id").min()["subgrid_level"].to_numpy()
)
subgrid_index = mapping.dataframe["subgrid_index"]
bound_index = mapping.dataframe["bound_index"]
Expand Down

0 comments on commit cd2da26

Please sign in to comment.