Skip to content

Commit

Permalink
fix in getComputedTimeSeries_ENepanet to accept arg
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariosmsk committed Aug 1, 2024
1 parent 4d75a6a commit b0dd2b4
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions epyt/epanet.py
Original file line number Diff line number Diff line change
Expand Up @@ -2387,14 +2387,25 @@ def getComputedTimeSeries(self):
value_final.Status = value_final.Status.astype(int)
return value_final

def getComputedTimeSeries_ENepanet(self):
def getComputedTimeSeries_ENepanet(self, tempfile=None, binfile=None, rptfile=None):
""" Run analysis using ENepanet function """
self.saveInputFile(self.TempInpFile)
uuID = ''.join(random.choices(string.ascii_letters +
string.digits, k=10))
rptfile = self.TempInpFile[0:-4] + '.txt'
binfile = '@#' + uuID + '.bin'
self.api.ENepanet(self.TempInpFile, rptfile, binfile)

if tempfile is not None:
self.saveInputFile(tempfile)
else:
self.saveInputFile(self.TempInpFile)
uuID = ''.join(random.choices(string.ascii_letters + string.digits, k=10))

if binfile is None:
binfile = '@#' + uuID + '.bin'
if rptfile is None:
rptfile = self.TempInpFile[:-4] + '.txt'
self.api.ENclose()
if tempfile is not None:
self.api.ENepanet(tempfile, rptfile, binfile)
else:
self.api.ENepanet(self.TempInpFile, rptfile, binfile)

fid = open(binfile, "rb")
value = self.__readEpanetBin(fid, binfile, 0)
value.WarnFlag = False
Expand Down

0 comments on commit b0dd2b4

Please sign in to comment.