Skip to content

Commit

Permalink
fix bug in getpattern
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariosmsk committed Mar 28, 2024
1 parent 0e3e185 commit d2e031a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions epyt/epanet.py
Original file line number Diff line number Diff line change
Expand Up @@ -14073,11 +14073,11 @@ def ENgetpatternvalue(self, index, period):
Returns:
value the pattern factor for the given time period.
"""
value = c_double()

if self._ph is not None:
value = c_double()
self.errcode = self._lib.EN_getpatternvalue(self._ph, int(index), period, byref(value))
else:
value = c_float()
self.errcode = self._lib.ENgetpatternvalue(int(index), period, byref(value))

self.ENgeterror()
Expand Down Expand Up @@ -15206,7 +15206,7 @@ def ENsetpattern(self, index, factors, nfactors):
if self._ph is not None:
self.errcode = self._lib.EN_setpattern(self._ph, int(index), (c_double * nfactors)(*factors), nfactors)
else:
self.errcode = self._lib.ENsetpattern(int(index), (c_double * nfactors)(*factors),
self.errcode = self._lib.ENsetpattern(int(index), (c_float * nfactors)(*factors),
nfactors)

self.ENgeterror()
Expand Down

0 comments on commit d2e031a

Please sign in to comment.