Skip to content

Commit

Permalink
Merge pull request #410 from kbonney/issue-409
Browse files Browse the repository at this point in the history
Addressing bug caused when `units="SI"` in a call to `write_inp()`
  • Loading branch information
kaklise committed Mar 26, 2024
2 parents e8d907f + 7c36be6 commit 214f1f4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions wntr/epanet/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,8 @@ def write(self, filename, wn, units=None, version=2.2, force_coordinates=False):
raise ValueError('Must pass a WaterNetworkModel object')
if units is not None and isinstance(units, str):
units=units.upper()
if units=="SI":
raise Exception("unit cannot be 'SI'")
self.flow_units = FlowUnits[units]
elif units is not None and isinstance(units, FlowUnits):
self.flow_units = units
Expand Down

0 comments on commit 214f1f4

Please sign in to comment.