Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariosmsk committed Apr 19, 2024
2 parents 85d0946 + 3849a45 commit 02ae224
Show file tree
Hide file tree
Showing 16 changed files with 329 additions and 350 deletions.
2 changes: 1 addition & 1 deletion epyt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
__author__ = """Marios S. Kyriakou"""
__email__ = "[email protected]"
__version__ = "1.0.9-beta.6"
__version__ = "1.1.0"
__msxversion__ = "2.0.0"
__copyright__ = """Copyright 2022, KIOS Research and Innovation Center of Excellence (KIOS CoE),
University of Cyprus (www.kios.org.cy)."""
Expand Down
332 changes: 170 additions & 162 deletions epyt/epanet.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions epyt/examples/python/EX6_load_two_inp_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from epyt import epanet

# Load networks
d1 = epanet('Net1.inp')
d2 = epanet('Net2.inp')
d1 = epanet('Net1.inp', ph=True)
d2 = epanet('Net2.inp', ph=True)

# Close any open figures
d1.plot_close()
Expand Down
4 changes: 2 additions & 2 deletions epyt/examples/python/EX_to_excel_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
""" ------------------- excel ---------------------------- """
# Create a .xlsx excel file and save all the values of each attribute
# in seperate sheet
comp_values.to_excel("to_excel_seperate_values_example")
# comp_values.to_excel("to_excel_seperate_values_example")

# Create a .xlsx excel file and save all the values in a sheet
comp_values.to_excel("to_excel_all_values_example", allValues=True)
# comp_values.to_excel("to_excel_all_values_example", allValues=True)

# Create a .xlsx excel file and select multiple attributes to be
# displayed in seperate sheets
Expand Down
4 changes: 2 additions & 2 deletions epyt/examples/python/Toolkit_EX4_Network_Building.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

# Create an empty INP file
testinp = 'TESTING.inp'
d = epanet(testinp, 'CREATE')
d = epanet(testinp, 'CREATE', ph=True)

# Initialize epanet flow units
d.initializeEPANET(d.ToolkitConstants.EN_GPM, d.ToolkitConstants.EN_HW)
Expand Down Expand Up @@ -69,7 +69,7 @@

# Save the project for future use
d.saveInputFile(testinp)
d = epanet(testinp)
d = epanet(testinp, ph=True)
d.plot()
d.plot_show()
d.deleteProject()
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
inpname = os.path.join(dirname, 'msx-examples', 'net2-cl2.inp')
msxname = os.path.join(dirname, 'msx-examples', 'net2-cl2.msx')

d = epanet(inpname, msx=True)
d = epanet(inpname)
msx = epanetmsxapi(msxname)
MSX_SPECIES = 3
ss = list(range(1, d.LinkCount + 1))
Expand Down
Binary file added epyt/libraries/glnx/epanetmsx
Binary file not shown.
Binary file added epyt/libraries/glnx/libepanet2
Binary file not shown.
Binary file added epyt/libraries/mac/epanetmsx
Binary file not shown.
Binary file added epyt/libraries/mac/libepanet2
Binary file not shown.
Binary file modified epyt/libraries/win/epanet2.dll
Binary file not shown.
Binary file modified epyt/libraries/win/epanet2.exe
Binary file not shown.
Binary file modified epyt/libraries/win/epanetmsx.exe
Binary file not shown.
321 changes: 146 additions & 175 deletions epyt/tests/general_unit_test.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion epyt/tests/net1_unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def setUp(self):
"""Call before every test case."""
# Create EPANET object using the INP file
inp_name = 'Net1.inp'
self.epanetClass = epanet(inp_name)
self.epanetClass = epanet(inp_name, ph=False)

def tearDown(self):
"""Call after every test case."""
Expand Down
8 changes: 4 additions & 4 deletions epyt/tests/test_unit_MSX.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def setUp(self):
# Create EPANET object using the INP file
inpname = os.path.join(DIRNAME, 'msx-examples', 'Net3-NH2CL.inp')
msxfile = os.path.join(DIRNAME, 'msx-examples', 'Net3-NH2CL.msx')
self.epanetClass = epanet(inpname, msx=True)
self.epanetClass = epanet(inpname)
self.msxClass = self.epanetClass.loadMSXFile(msxfile)

def tearDown(self):
Expand Down Expand Up @@ -253,7 +253,7 @@ def test_MSXgetqual(self):
self.msxClass.MSXclose()
self.epanetClass.unload()
inpname = os.path.join(DIRNAME, 'msx-examples', 'net2-cl2.inp')
self.epanetClass = epanet(inpname, msx=True)
self.epanetClass = epanet(inpname)
file_path = os.path.join(DIRNAME, 'msx-examples', 'net2-cl2.msx')
self.msxClass = self.epanetClass.loadMSXFile(file_path)

Expand All @@ -270,10 +270,10 @@ def test_MSXgetqual(self):
self.assertEqual(self.msxClass.MSXgetqual(0, 1, 1), 0.8,
'Wrong get qual comment output')
if c == 85:
self.assertEqual(self.msxClass.MSXgetqual(0, 1, 1), 0.7991662288393907,
self.assertEqual(self.msxClass.MSXgetqual(0, 1, 1), 0.7991666666666667,
'Wrong get qual comment output')
if c == 660:
self.assertEqual(self.msxClass.MSXgetqual(0, 1, 1), 0.7999999830262526,
self.assertEqual(self.msxClass.MSXgetqual(0, 1, 1), 0.8,
'Wrong get qual comment output')
if tleft <= 0:
break
Expand Down

0 comments on commit 02ae224

Please sign in to comment.