Skip to content

Commit 4a6a672

Browse files
authored
Merge pull request #35 from michaeltryby/dev
update library from epanet2 to epanet_py
2 parents d630252 + 9604c22 commit 4a6a672

3 files changed

Lines changed: 9 additions & 10 deletions

File tree

before_build.bat

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ set OUTPUT_PATH=\epanet_python\output\epanet\output
1515

1616
mkdir buildlib
1717
cd buildlib
18-
git clone --branch=dev-swig-redux https://github.com/michaeltryby/EPANET.git
18+
git clone --branch=dev https://github.com/michaeltryby/EPANET.git
1919
cd epanet
2020

2121

2222
mkdir buildprod
2323
cd buildprod
24-
cmake -G"Visual Studio 14 2015 Win64" -DBUILD_TESTS=0 ..
24+
cmake -G"Visual Studio 14 2015 Win64" -DBUILD_PY_LIB=ON -DBUILD_TESTS=OFF ..
2525
cmake --build . --config Release
2626

2727

28-
copy /Y .\bin\Release\epanet2.dll %PROJECT_PATH%\%TOOLKIT_PATH%
29-
copy /Y .\lib\Release\epanet2.lib %PROJECT_PATH%\%TOOLKIT_PATH%
28+
copy /Y .\bin\Release\epanet_py.dll %PROJECT_PATH%\%TOOLKIT_PATH%
29+
copy /Y .\lib\Release\epanet_py.lib %PROJECT_PATH%\%TOOLKIT_PATH%
3030
copy /Y ..\include\*.h %PROJECT_PATH%\%TOOLKIT_PATH%
3131

3232
copy /Y .\bin\Release\epanet-output.dll %PROJECT_PATH%\%OUTPUT_PATH%

epanet_python/toolkit/epanet/toolkit/toolkit.i

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ int node_getindex(Handle ph, char *id, int *OUTPUT);
166166
int node_getid(Handle ph, int index, char *id_out);
167167
int node_setid(Handle ph, int index, char *newid);
168168
int node_gettype(Handle ph, int index, int *OUTPUT);
169-
int node_getvalue(Handle ph, int index, int code, double *OUTPUT);
170-
int node_setvalue(Handle ph, int index, int code, double value);
169+
int node_getvalue(Handle ph, int index, EN_NodeProperty code, double *OUTPUT);
170+
int node_setvalue(Handle ph, int index, EN_NodeProperty code, double value);
171171
int node_getcoord(Handle ph, int index, double *OUTPUT, double *OUTPUT);
172172
int node_setcoord(Handle ph, int index, double x, double y);
173173

epanet_python/toolkit/setup.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,21 @@
2323

2424
setup(
2525
name = microlib_name,
26-
version = "0.0.2a0",
26+
version = "0.0.3a0",
2727
ext_modules = [
2828
Extension("epanet.toolkit._toolkit",
2929
sources = ['epanet/toolkit/toolkit.i'],
3030
swig_opts = ['-py3'],
3131
include_dirs = ['epanet/toolkit'],
3232
library_dirs = ['epanet/toolkit'],
33-
libraries = ['epanet2'],
34-
extra_compile_args = ["/D WITH_GENX"],
33+
libraries = ['epanet_py'],
3534
language = 'C'
3635
)
3736
],
3837
namespace_packages = ['epanet'],
3938
packages = {microlib_name},
4039
py_modules = ['toolkit'],
4140
# include_package_data=True
42-
package_data = {microlib_name:['*epanet2.dll', '*epanet2.so']},
41+
package_data = {microlib_name:['*epanet_py.dll', '*epanet_py.so']},
4342

4443
)

0 commit comments

Comments
 (0)