Skip to content

Commit c1088ef

Browse files
authored
Merge pull request #17 from michaeltryby/dev
Preparing for pre-release
2 parents d0f7dd9 + 54fa2c4 commit c1088ef

File tree

6 files changed

+72
-19
lines changed

6 files changed

+72
-19
lines changed

output/setup.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
# -*- coding: utf-8 -*-
22

33
#
4-
# setup.py
4+
# setup.py - Setup script for swmm_output python extension
55
#
6-
# Author: Michael E. Tryby
7-
# US EPA - ORD/NRMRL
6+
# Created: 7/2/2018
7+
# Author: Michael E. Tryby
8+
# US EPA - ORD/NRMRL
89
#
10+
# Requires:
11+
# Platform C language compiler
12+
# SWIG
913
#
1014

11-
'''Setup up script for SWMM Output API python extension'''
12-
1315
try:
1416
from setuptools import setup, Extension
1517
from setuptools.command.build_ext import build_ext
@@ -20,7 +22,7 @@
2022

2123
setup(
2224
name = "swmm-output",
23-
version = "0.1.0-alpha",
25+
version = "0.2.0-dev",
2426

2527
ext_modules = [
2628
Extension("swmm.output._output",
@@ -35,8 +37,4 @@
3537
packages = ['swmm.output'],
3638
py_modules = ['output'],
3739
package_data = {'swmm.output':['*swmm-output.dll', '*swmm-output.so']},
38-
39-
install_requires = [
40-
'enum34'
41-
]
4240
)

output/swmm/output/__init__.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
1+
# -*- coding: utf-8 -*-
12

2-
from swmm.output import output
3+
#
4+
# __init__.py - SWMM output package
5+
#
6+
# Date Created: August 9, 2018
7+
#
8+
# Author: Michael E. Tryby
9+
# US EPA - ORD/NRMRL
10+
#
11+
12+
'''
13+
A low level pythonic API for the swmm-output dll using SWIG.
14+
'''
15+
16+
17+
__author__ = "Michael Tryby"
18+
__copyright__ = "None"
19+
__credits__ = "Colleen Barr"
20+
__license__ = "CC0 1.0 Universal"
21+
22+
__version__ = "0.2.0"
23+
__date__ = "August 9, 2018"
24+
25+
__maintainer__ = "Michael Tryby"
26+
__email__ = "[email protected]"
27+
__status = "Development"
328

429

530
# Units of Measurement

output/swmm/output/output.i

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ and return a (possibly) different pointer */
111111
{
112112
/* OUTPUT argout */
113113
%append_output(SWIG_NewPointerObj(SWIG_as_voidptr(retval$argnum), $1_descriptor, 0));
114+
}
115+
%typemap(in) SMO_Handle* p_handle_inout (SMO_Handle retval)
116+
{
117+
/* INOUT in */
118+
SWIG_ConvertPtr(obj0,SWIG_as_voidptrptr(&retval), 0, 0);
119+
$1 = &retval;
114120
}
115121
/* No need for special IN typemap for opaque pointers, it works anyway */
116122

@@ -271,7 +277,7 @@ int DLLEXPORT SMO_getSystemResult(SMO_Handle p_handle, int timeIndex,
271277

272278
/* NO EXCEPTION HANDLING FOR THESE FUNCTIONS */
273279
int DLLEXPORT SMO_init(SMO_Handle* p_handle_out);
274-
int DLLEXPORT SMO_close(SMO_Handle* p_handle_out);
280+
int DLLEXPORT SMO_close(SMO_Handle* p_handle_inout);
275281
void DLLEXPORT SMO_free(void** array);
276282

277283
void DLLEXPORT SMO_clearError(SMO_Handle p_handle);

output/tests/test_output.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
def test_openclose():
2020
_handle = smo.init()
2121
smo.open(_handle, OUTPUT_FILE_EXAMPLE1)
22-
smo.close()
22+
smo.close(_handle)
2323

2424

2525
@pytest.fixture()
@@ -28,7 +28,7 @@ def handle(request):
2828
smo.open(_handle, OUTPUT_FILE_EXAMPLE1)
2929

3030
def close():
31-
smo.close()
31+
smo.close(_handle)
3232

3333
request.addfinalizer(close)
3434
return _handle

toolkit/setup.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# -*- coding: utf-8 -*-
2+
23
#
34
# setup.py - Setup script for swmm_toolkit python extension
45
#
@@ -21,7 +22,7 @@
2122

2223
setup(
2324
name = 'swmm_toolkit',
24-
version = '0.0.1',
25+
version = '0.2.0-dev',
2526

2627
ext_modules = [
2728
Extension('swmm.toolkit._toolkit',
@@ -37,8 +38,4 @@
3738
packages=['swmm.toolkit'],
3839
py_modules = ['toolkit'],
3940
package_data = {'swmm.toolkit':['*swmm5.dll', '*swmm5.so']},
40-
41-
install_requires = [
42-
'enum34'
43-
]
4441
)

toolkit/swmm/toolkit/__init__.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,28 @@
1+
# -*- coding: utf-8 -*-
2+
3+
#
4+
# __init__.py - SWMM toolkit package
5+
#
6+
# Date Created: August 9, 2018
7+
#
8+
# Author: Michael E. Tryby
9+
# US EPA - ORD/NRMRL
10+
#
11+
12+
'''
13+
A low level pythonic API for the swmm5 dll using SWIG.
14+
'''
15+
16+
17+
__author__ = "Michael Tryby"
18+
__copyright__ = "None"
19+
__credits__ = "Bryant McDonnell"
20+
__license__ = "CC0 1.0 Universal"
21+
22+
__version__ = "0.2.0"
23+
__date__ = "August 9, 2018"
24+
25+
__maintainer__ = "Michael Tryby"
26+
__email__ = "[email protected]"
27+
__status = "Development"
128

0 commit comments

Comments
 (0)