Skip to content

Commit

Permalink
fix bug in setNodeDemandPatternIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariosmsk committed Aug 1, 2024
1 parent 1d04894 commit 4d75a6a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions epyt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
__email__ = "[email protected]"
__version__ = "1.2.0"
__msxversion__ = "200000"
__lastupdate__ = "18/07/2024"
__lastupdate__ = "01/08/2024"
__copyright__ = """Copyright 2022, KIOS Research and Innovation Center of Excellence (KIOS CoE),
University of Cyprus (www.kios.org.cy)."""
__license__ = "EUPL License, Version 1.2"

from epyt.epanet import epanet
from epyt.epanet import epanet
10 changes: 5 additions & 5 deletions epyt/epanet.py
Original file line number Diff line number Diff line change
Expand Up @@ -11217,14 +11217,14 @@ def __setNodeDemandPattern(self, fun, propertyCode, value, *argv):
param = [param]
for i in indices:
if i in resInd:
if c + 1 > self.getNodeDemandCategoriesNumber(i):
self.api.ENsetnodevalue(i, propertyCode, param[j])
elif categ == 1 or len(indices) == 1:
eval('self.api.' + fun + '(i, categ, param[j])')
else:
if c + 1 > self.getNodeDemandCategoriesNumber(i):
self.addNodeJunctionDemand(i, param[j])
else:
eval('self.api.' + fun + '(i, c, param[j])')
elif categ == 1:
self.api.ENsetnodevalue(i, propertyCode, param[j])
else:
eval('self.api.' + fun + '(i, categ, param[j])')
j += 1

"""MSX Functions"""
Expand Down

0 comments on commit 4d75a6a

Please sign in to comment.