Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions output/setup.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# -*- coding: utf-8 -*-

#
# setup.py
# setup.py - Setup script for swmm_output python extension
#
# Author: Michael E. Tryby
# US EPA - ORD/NRMRL
# Created: 7/2/2018
# Author: Michael E. Tryby
# US EPA - ORD/NRMRL
#
# Requires:
# Platform C language compiler
# SWIG
#

'''Setup up script for SWMM Output API python extension'''

try:
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
Expand All @@ -20,7 +22,7 @@

setup(
name = "swmm-output",
version = "0.1.0-alpha",
version = "0.2.0-dev",

ext_modules = [
Extension("swmm.output._output",
Expand All @@ -35,8 +37,4 @@
packages = ['swmm.output'],
py_modules = ['output'],
package_data = {'swmm.output':['*swmm-output.dll', '*swmm-output.so']},

install_requires = [
'enum34'
]
)
27 changes: 26 additions & 1 deletion output/swmm/output/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# -*- coding: utf-8 -*-

from swmm.output import output
#
# __init__.py - SWMM output package
#
# Date Created: August 9, 2018
#
# Author: Michael E. Tryby
# US EPA - ORD/NRMRL
#

'''
A low level pythonic API for the swmm-output dll using SWIG.
'''


__author__ = "Michael Tryby"
__copyright__ = "None"
__credits__ = "Colleen Barr"
__license__ = "CC0 1.0 Universal"

__version__ = "0.2.0"
__date__ = "August 9, 2018"

__maintainer__ = "Michael Tryby"
__email__ = "tryby.michael@epa.gov"
__status = "Development"


# Units of Measurement
Expand Down
8 changes: 7 additions & 1 deletion output/swmm/output/output.i
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ and return a (possibly) different pointer */
{
/* OUTPUT argout */
%append_output(SWIG_NewPointerObj(SWIG_as_voidptr(retval$argnum), $1_descriptor, 0));
}
%typemap(in) SMO_Handle* p_handle_inout (SMO_Handle retval)
{
/* INOUT in */
SWIG_ConvertPtr(obj0,SWIG_as_voidptrptr(&retval), 0, 0);
$1 = &retval;
}
/* No need for special IN typemap for opaque pointers, it works anyway */

Expand Down Expand Up @@ -271,7 +277,7 @@ int DLLEXPORT SMO_getSystemResult(SMO_Handle p_handle, int timeIndex,

/* NO EXCEPTION HANDLING FOR THESE FUNCTIONS */
int DLLEXPORT SMO_init(SMO_Handle* p_handle_out);
int DLLEXPORT SMO_close(SMO_Handle* p_handle_out);
int DLLEXPORT SMO_close(SMO_Handle* p_handle_inout);
void DLLEXPORT SMO_free(void** array);

void DLLEXPORT SMO_clearError(SMO_Handle p_handle);
Expand Down
4 changes: 2 additions & 2 deletions output/tests/test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
def test_openclose():
_handle = smo.init()
smo.open(_handle, OUTPUT_FILE_EXAMPLE1)
smo.close()
smo.close(_handle)


@pytest.fixture()
Expand All @@ -28,7 +28,7 @@ def handle(request):
smo.open(_handle, OUTPUT_FILE_EXAMPLE1)

def close():
smo.close()
smo.close(_handle)

request.addfinalizer(close)
return _handle
Expand Down
7 changes: 2 additions & 5 deletions toolkit/setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-

#
# setup.py - Setup script for swmm_toolkit python extension
#
Expand All @@ -21,7 +22,7 @@

setup(
name = 'swmm_toolkit',
version = '0.0.1',
version = '0.2.0-dev',

ext_modules = [
Extension('swmm.toolkit._toolkit',
Expand All @@ -37,8 +38,4 @@
packages=['swmm.toolkit'],
py_modules = ['toolkit'],
package_data = {'swmm.toolkit':['*swmm5.dll', '*swmm5.so']},

install_requires = [
'enum34'
]
)
27 changes: 27 additions & 0 deletions toolkit/swmm/toolkit/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
# -*- coding: utf-8 -*-

#
# __init__.py - SWMM toolkit package
#
# Date Created: August 9, 2018
#
# Author: Michael E. Tryby
# US EPA - ORD/NRMRL
#

'''
A low level pythonic API for the swmm5 dll using SWIG.
'''


__author__ = "Michael Tryby"
__copyright__ = "None"
__credits__ = "Bryant McDonnell"
__license__ = "CC0 1.0 Universal"

__version__ = "0.2.0"
__date__ = "August 9, 2018"

__maintainer__ = "Michael Tryby"
__email__ = "tryby.michael@epa.gov"
__status = "Development"