Skip to content

Commit

Permalink
remove leak attributes from optional attributes and delete them when …
Browse files Browse the repository at this point in the history
…creating geojsons instead.
  • Loading branch information
kbonney committed Nov 19, 2024
1 parent 46efc83 commit b7af055
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
5 changes: 5 additions & 0 deletions wntr/gis/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ def _extract_geodataframe(df, crs=None, valid_base_names=None,
if 'node_type' in df.columns:
geom = [Point((x,y)) for x,y in df['coordinates']]
del df['node_type']

# do not carry over leak attributes to dataframe.
del df['leak']
del df['leak_area']
del df['leak_discharge_coeff']
elif 'link_type' in df.columns:
geom = []
for link_name in df['name']:
Expand Down
10 changes: 2 additions & 8 deletions wntr/network/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,7 @@ class Junction(Node):
"minimum_pressure",
"required_pressure",
"pressure_exponent",
"tag",
"leak",
"leak_area",
"leak_discharge_coeff"]
"tag"]

def __init__(self, name, wn):
super(Junction, self).__init__(wn, name)
Expand Down Expand Up @@ -434,10 +431,7 @@ class Tank(Node):
"mixing_fraction",
"mixing_model",
"bulk_coeff",
"tag",
"leak",
"leak_area",
"leak_discharge_coeff"]
"tag"]

def __init__(self, name, wn):
super(Tank, self).__init__(wn, name)
Expand Down

0 comments on commit b7af055

Please sign in to comment.