Skip to content

Commit

Permalink
fix getComputedTimeSeries
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariosmsk committed Apr 19, 2024
1 parent 89baac6 commit f8840fb
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions epyt/epanet.py
Original file line number Diff line number Diff line change
Expand Up @@ -2415,6 +2415,7 @@ def getComputedTimeSeries_ENepanet(self):
else:
exec(f"value_final.{i} = val_dict[i]")
value_final.Status = value_final.Status.astype(int)
self.loadEPANETFile(self.TempInpFile)
return value_final

def getAdjacencyMatrix(self):
Expand Down Expand Up @@ -12860,7 +12861,6 @@ def __init__(self, version=2.2, ph=False, loadlib=True, customlib=None):
"""
self._lib = None
self.errcode = 0
self.isloaded = False
self.inpfile = None
self.rptfile = None
self.binfile = None
Expand Down Expand Up @@ -13093,8 +13093,6 @@ def ENclose(self):
self.errcode = self._lib.ENclose()

self.ENgeterror()
if self.errcode < 100:
self.isloaded = False

def ENcloseH(self):
""" Closes the hydraulic solver freeing all of its allocated memory.
Expand Down Expand Up @@ -14624,20 +14622,13 @@ def ENopen(self, inpname=None, repname=None, binname=None):
self.rptfile = bytes(repname, 'utf-8')
self.binfile = bytes(binname, 'utf-8')

if self.isloaded:
self.ENclose()
if self.isloaded:
raise RuntimeError("File is loaded and cannot be closed.")

if self._ph is not None:
self._lib.EN_createproject(byref(self._ph))
self.errcode = self._lib.EN_open(self._ph, self.inpfile, self.rptfile, self.binfile)
else:
self.errcode = self._lib.ENopen(self.inpfile, self.rptfile, self.binfile)

self.ENgeterror()
if self.errcode < 100:
self.isloaded = True
return

def ENopenH(self):
Expand Down

0 comments on commit f8840fb

Please sign in to comment.