Skip to content

Commit

Permalink
Allow a DataArray in polygon_to_hfb
Browse files Browse the repository at this point in the history
  • Loading branch information
rubencalje committed Mar 15, 2024
1 parent f7a34dc commit 97182fa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nlmod/gwf/horizontal_flow_barrier.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import xarray as xr
from shapely.geometry import Point, Polygon

from ..dims.grid import gdf_to_da, gdf_to_grid
Expand Down Expand Up @@ -217,7 +218,9 @@ def line2hfb(gdf, gwf, prevent_rings=True, plot=False):
def polygon_to_hfb(
gdf, ds, column=None, gwf=None, lay=0, hydchr=1 / 100, add_data=False
):
if isinstance(gdf, str):
if isinstance(gdf, xr.DataArray):
da = gdf
elif isinstance(gdf, str):
da = ds[gdf]
else:
if column is None:
Expand Down

0 comments on commit 97182fa

Please sign in to comment.