Skip to content

Commit

Permalink
Merge pull request #7 from NHFLO/bdestombe-polder-patch-1
Browse files Browse the repository at this point in the history
Update polder.py
  • Loading branch information
bdestombe authored Nov 14, 2024
2 parents 20d030e + 6816b0d commit d8b16ce
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/nhflotools/polder.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ def drn_from_waterboard_data(ds, gwf, wb="Hollands Noorderkwartier", cbot=1.0):
if gdf.empty:
return None

# Rename duplicate indices
counts = Counter(gdf.index)
suffix_counter = defaultdict(lambda: itertools.count(1))
index2 = [elem if counts[elem] == 1 else elem + f'_{next(suffix_counter[elem])}'
for elem in gdf.index]
gdf.index = index2

gdf_grid = nlmod.grid.gdf_to_grid(gdf.loc[:, ["summer_stage", "winter_stage", "geometry"]], gwf)
fields_methods = {
"summer_stage": "area_weighted",
Expand Down

0 comments on commit d8b16ce

Please sign in to comment.