openswmm 6.0.0.dev2__cp310-cp310-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bin/__init__.py +10 -0
- bin/concrt140.dll +0 -0
- bin/msvcp140.dll +0 -0
- bin/msvcp140_1.dll +0 -0
- bin/msvcp140_2.dll +0 -0
- bin/msvcp140_atomic_wait.dll +0 -0
- bin/msvcp140_codecvt_ids.dll +0 -0
- bin/vcomp140.dll +0 -0
- bin/vcruntime140.dll +0 -0
- bin/vcruntime140_1.dll +0 -0
- openswmm/CMakeLists.txt +113 -0
- openswmm/__init__.py +93 -0
- openswmm/data/__init__.py +0 -0
- openswmm/engine/CMakeLists.txt +68 -0
- openswmm/engine/_2d.cp310-win_amd64.pyd +0 -0
- openswmm/engine/_2d.pxd +83 -0
- openswmm/engine/_2d.pyi +646 -0
- openswmm/engine/__init__.pxd +6 -0
- openswmm/engine/__init__.py +277 -0
- openswmm/engine/__init__.pyi +114 -0
- openswmm/engine/_common.pxd +862 -0
- openswmm/engine/_controls.cp310-win_amd64.pyd +0 -0
- openswmm/engine/_controls.pyi +152 -0
- openswmm/engine/_dates.py +35 -0
- openswmm/engine/_dates.pyi +7 -0
- openswmm/engine/_edit.cp310-win_amd64.pyd +0 -0
- openswmm/engine/_edit.pyi +412 -0
- openswmm/engine/_enums.py +620 -0
- openswmm/engine/_enums.pyi +604 -0
- openswmm/engine/_forcing.cp310-win_amd64.pyd +0 -0
- openswmm/engine/_forcing.pyi +323 -0
- openswmm/engine/_gages.cp310-win_amd64.pyd +0 -0
- openswmm/engine/_gages.pyi +248 -0
- openswmm/engine/_geometry.py +129 -0
- openswmm/engine/_geopackage.cp310-win_amd64.pyd +0 -0
- openswmm/engine/_geopackage.pyi +425 -0
- openswmm/engine/_hotstart.cp310-win_amd64.pyd +0 -0
- openswmm/engine/_hotstart.pyi +374 -0
- openswmm/engine/_inflows.cp310-win_amd64.pyd +0 -0
- openswmm/engine/_inflows.pyi +339 -0
- openswmm/engine/_infrastructure.cp310-win_amd64.pyd +0 -0
- openswmm/engine/_infrastructure.pyi +349 -0
- openswmm/engine/_links.cp310-win_amd64.pyd +0 -0
- openswmm/engine/_links.pyi +1106 -0
- openswmm/engine/_massbalance.cp310-win_amd64.pyd +0 -0
- openswmm/engine/_massbalance.pyi +170 -0
- openswmm/engine/_model.cp310-win_amd64.pyd +0 -0
- openswmm/engine/_model.pyi +535 -0
- openswmm/engine/_nodes.cp310-win_amd64.pyd +0 -0
- openswmm/engine/_nodes.pyi +910 -0
- openswmm/engine/_output_reader.cp310-win_amd64.pyd +0 -0
- openswmm/engine/_output_reader.pyi +529 -0
- openswmm/engine/_pollutants.cp310-win_amd64.pyd +0 -0
- openswmm/engine/_pollutants.pyi +419 -0
- openswmm/engine/_quality.cp310-win_amd64.pyd +0 -0
- openswmm/engine/_quality.pyi +296 -0
- openswmm/engine/_report.py +461 -0
- openswmm/engine/_solver.cp310-win_amd64.pyd +0 -0
- openswmm/engine/_solver.pxd +16 -0
- openswmm/engine/_solver.pyi +625 -0
- openswmm/engine/_spatial.cp310-win_amd64.pyd +0 -0
- openswmm/engine/_spatial.pyi +313 -0
- openswmm/engine/_statistics.cp310-win_amd64.pyd +0 -0
- openswmm/engine/_statistics.pyi +364 -0
- openswmm/engine/_subcatchments.cp310-win_amd64.pyd +0 -0
- openswmm/engine/_subcatchments.pyi +779 -0
- openswmm/engine/_tables.cp310-win_amd64.pyd +0 -0
- openswmm/engine/_tables.pyi +230 -0
- openswmm/engine/hdf5.dll +0 -0
- openswmm/engine/openswmm.engine.dll +0 -0
- openswmm/engine/openswmm.engine.lib +0 -0
- openswmm/engine/sqlite3.dll +0 -0
- openswmm/engine/sundials_core.dll +0 -0
- openswmm/engine/sundials_cvode.dll +0 -0
- openswmm/legacy/CMakeLists.txt +3 -0
- openswmm/legacy/__init__.py +13 -0
- openswmm/legacy/engine/CMakeLists.txt +14 -0
- openswmm/legacy/engine/__init__.pxd +1 -0
- openswmm/legacy/engine/__init__.py +42 -0
- openswmm/legacy/engine/_forcing_log.py +94 -0
- openswmm/legacy/engine/_links.py +265 -0
- openswmm/legacy/engine/_nodes.py +237 -0
- openswmm/legacy/engine/_raingages.py +107 -0
- openswmm/legacy/engine/_solver.cp310-win_amd64.pyd +0 -0
- openswmm/legacy/engine/_solver.pyi +1049 -0
- openswmm/legacy/engine/_subcatchments.py +282 -0
- openswmm/legacy/engine/_system.py +133 -0
- openswmm/legacy/engine/openswmm.legacy.engine.dll +0 -0
- openswmm/legacy/engine/openswmm.legacy.engine.lib +0 -0
- openswmm/legacy/engine/solver.pxd +500 -0
- openswmm/legacy/output/CMakeLists.txt +11 -0
- openswmm/legacy/output/__init__.pxd +1 -0
- openswmm/legacy/output/__init__.py +24 -0
- openswmm/legacy/output/_output.cp310-win_amd64.pyd +0 -0
- openswmm/legacy/output/_output.pyi +732 -0
- openswmm/legacy/output/openswmm.legacy.output.dll +0 -0
- openswmm/legacy/output/openswmm.legacy.output.lib +0 -0
- openswmm/legacy/output/output.pxd +368 -0
- openswmm/output/CMakeLists.txt +43 -0
- openswmm/output/__init__.pxd +1 -0
- openswmm/output/__init__.py +33 -0
- openswmm/output/_output.pyi +832 -0
- openswmm/output/output.pxd +368 -0
- openswmm/solver/CMakeLists.txt +51 -0
- openswmm/solver/__init__.pxd +1 -0
- openswmm/solver/__init__.py +41 -0
- openswmm/solver/_solver.pyi +1298 -0
- openswmm/solver/solver.pxd +356 -0
- openswmm-6.0.0.dev2.dist-info/DELVEWHEEL +2 -0
- openswmm-6.0.0.dev2.dist-info/METADATA +261 -0
- openswmm-6.0.0.dev2.dist-info/RECORD +122 -0
- openswmm-6.0.0.dev2.dist-info/WHEEL +5 -0
- openswmm-6.0.0.dev2.dist-info/licenses/LICENSE +9 -0
- openswmm.libs/hdf5-4163cfd73f3ba00da6c1f508aa807f02.dll +0 -0
- openswmm.libs/msvcp140-0f885b509a685d2bbfa652fed26b5fb3.dll +0 -0
- openswmm.libs/openswmm.engine-a63683e51cfd18e92a167ae089bbde37.dll +0 -0
- openswmm.libs/openswmm.legacy.engine-ef5528232714faf6b90655b7faad49ee.dll +0 -0
- openswmm.libs/openswmm.legacy.output-de26979e39c0ca24a19ee2dc165659e6.dll +0 -0
- openswmm.libs/sqlite3-d959feb0d926553df962959041905db2.dll +0 -0
- openswmm.libs/sundials_core-fe8f70b2a2b7be97035811d44f9df436.dll +0 -0
- openswmm.libs/sundials_cvode-a24ab04eb7d6a5277d0d8ccacd4d3537.dll +0 -0
- openswmm.libs/vcomp140-55aba23cdcd6484fbb06f4155b8ca75a.dll +0 -0
bin/__init__.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""""" # start delvewheel patch
|
|
2
|
+
def _delvewheel_patch_1_12_1():
|
|
3
|
+
import os
|
|
4
|
+
if os.path.isdir(libs_dir := os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'openswmm.libs'))):
|
|
5
|
+
os.add_dll_directory(libs_dir)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
_delvewheel_patch_1_12_1()
|
|
9
|
+
del _delvewheel_patch_1_12_1
|
|
10
|
+
# end delvewheel patch
|
bin/concrt140.dll
ADDED
|
Binary file
|
bin/msvcp140.dll
ADDED
|
Binary file
|
bin/msvcp140_1.dll
ADDED
|
Binary file
|
bin/msvcp140_2.dll
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
bin/vcomp140.dll
ADDED
|
Binary file
|
bin/vcruntime140.dll
ADDED
|
Binary file
|
bin/vcruntime140_1.dll
ADDED
|
Binary file
|
openswmm/CMakeLists.txt
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# ============================================================================
|
|
2
|
+
# openswmm package — top-level Cython extension + subpackage delegation
|
|
3
|
+
#
|
|
4
|
+
# Builds the root _openswmm stub (if ever re-added) and delegates to:
|
|
5
|
+
# engine/ — new 6.x bindings
|
|
6
|
+
# legacy/ — legacy 5.x solver + output reader
|
|
7
|
+
#
|
|
8
|
+
# Shared libraries installed via CMake are placed next to each extension:
|
|
9
|
+
# openswmm/engine/libopenswmm.engine.*
|
|
10
|
+
# openswmm/legacy/engine/libopenswmm.legacy.engine.*
|
|
11
|
+
# openswmm/legacy/output/libopenswmm.legacy.output.*
|
|
12
|
+
# ============================================================================
|
|
13
|
+
|
|
14
|
+
add_subdirectory(engine)
|
|
15
|
+
add_subdirectory(legacy)
|
|
16
|
+
|
|
17
|
+
# ---------------------------------------------------------------------------
|
|
18
|
+
# Install shared libraries alongside the Cython extensions so that
|
|
19
|
+
# @loader_path / $ORIGIN RPATH entries resolve at runtime.
|
|
20
|
+
#
|
|
21
|
+
# In pre-built mode the targets are IMPORTED; cmake forbids install(TARGETS)
|
|
22
|
+
# on imported targets, so we resolve the path via IMPORTED_LOCATION instead.
|
|
23
|
+
# ---------------------------------------------------------------------------
|
|
24
|
+
if(NOT OPENSWMM_USE_PREBUILT_ENGINE)
|
|
25
|
+
# On Windows, gather the transitive runtime DLL closure of every engine
|
|
26
|
+
# library into a single RUNTIME_DEPENDENCY_SET so it gets bundled into
|
|
27
|
+
# the wheel alongside the .pyd files. Without this, `pip install .` on
|
|
28
|
+
# Windows produces a wheel where the engine DLL is present but its
|
|
29
|
+
# dependencies (OpenMP vcomp140.dll, vcpkg-installed runtime libs, etc.)
|
|
30
|
+
# are absent — Python's loader then fails with
|
|
31
|
+
# "DLL load failed while importing _solver: The specified module
|
|
32
|
+
# could not be found."
|
|
33
|
+
# The cibuildwheel path uses delvewheel, which performs the same bundling
|
|
34
|
+
# at wheel-repair time; this CMake-level rule mirrors that behaviour for
|
|
35
|
+
# the `pip install .` (no delvewheel) path.
|
|
36
|
+
set(_openswmm_runtime_dep_set "")
|
|
37
|
+
if(WIN32)
|
|
38
|
+
set(_openswmm_runtime_dep_set
|
|
39
|
+
RUNTIME_DEPENDENCY_SET openswmm_runtime_deps)
|
|
40
|
+
endif()
|
|
41
|
+
|
|
42
|
+
install(TARGETS openswmm_engine
|
|
43
|
+
${_openswmm_runtime_dep_set}
|
|
44
|
+
LIBRARY DESTINATION openswmm/engine
|
|
45
|
+
ARCHIVE DESTINATION openswmm/engine
|
|
46
|
+
RUNTIME DESTINATION openswmm/engine
|
|
47
|
+
)
|
|
48
|
+
install(TARGETS openswmm_legacy_engine
|
|
49
|
+
${_openswmm_runtime_dep_set}
|
|
50
|
+
LIBRARY DESTINATION openswmm/legacy/engine
|
|
51
|
+
ARCHIVE DESTINATION openswmm/legacy/engine
|
|
52
|
+
RUNTIME DESTINATION openswmm/legacy/engine
|
|
53
|
+
)
|
|
54
|
+
install(TARGETS openswmm_legacy_output
|
|
55
|
+
${_openswmm_runtime_dep_set}
|
|
56
|
+
LIBRARY DESTINATION openswmm/legacy/output
|
|
57
|
+
ARCHIVE DESTINATION openswmm/legacy/output
|
|
58
|
+
RUNTIME DESTINATION openswmm/legacy/output
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
if(WIN32)
|
|
62
|
+
install(RUNTIME_DEPENDENCY_SET openswmm_runtime_deps
|
|
63
|
+
DESTINATION openswmm/engine
|
|
64
|
+
# Skip OS-supplied DLLs that ship with every Windows installation
|
|
65
|
+
# (Python loader finds them in System32 anyway, and shipping them
|
|
66
|
+
# into a wheel would conflict with the loaded copies).
|
|
67
|
+
PRE_EXCLUDE_REGEXES
|
|
68
|
+
"api-ms-.*\\.dll"
|
|
69
|
+
"ext-ms-.*\\.dll"
|
|
70
|
+
"[Kk]ernel32\\.dll"
|
|
71
|
+
"[Nn]tdll\\.dll"
|
|
72
|
+
"[Mm]svcrt\\.dll"
|
|
73
|
+
"ucrtbase\\.dll"
|
|
74
|
+
"vcruntime[0-9]+\\.dll"
|
|
75
|
+
"msvcp[0-9]+\\.dll"
|
|
76
|
+
"concrt[0-9]+\\.dll"
|
|
77
|
+
"[Pp]ython[0-9]+\\.dll"
|
|
78
|
+
POST_EXCLUDE_REGEXES
|
|
79
|
+
".*[Ww]indows[/\\\\][Ss]ystem32.*"
|
|
80
|
+
".*[Ww]indows[/\\\\][Ss]ys[Ww][Oo][Ww]64.*"
|
|
81
|
+
)
|
|
82
|
+
endif()
|
|
83
|
+
else()
|
|
84
|
+
foreach(_entry
|
|
85
|
+
"OpenSWMMEngine::openswmm_engine|openswmm/engine"
|
|
86
|
+
"OpenSWMMEngine::openswmm_legacy_engine|openswmm/legacy/engine"
|
|
87
|
+
"OpenSWMMEngine::openswmm_legacy_output|openswmm/legacy/output"
|
|
88
|
+
)
|
|
89
|
+
string(REPLACE "|" ";" _pair "${_entry}")
|
|
90
|
+
list(GET _pair 0 _tgt)
|
|
91
|
+
list(GET _pair 1 _dest)
|
|
92
|
+
|
|
93
|
+
get_target_property(_loc "${_tgt}" IMPORTED_LOCATION)
|
|
94
|
+
if(NOT _loc)
|
|
95
|
+
get_target_property(_loc "${_tgt}" IMPORTED_LOCATION_RELEASE)
|
|
96
|
+
endif()
|
|
97
|
+
if(_loc)
|
|
98
|
+
install(FILES "${_loc}" DESTINATION "${_dest}")
|
|
99
|
+
else()
|
|
100
|
+
message(WARNING "IMPORTED_LOCATION not found for ${_tgt} — dylib missing from wheel")
|
|
101
|
+
endif()
|
|
102
|
+
|
|
103
|
+
if(WIN32)
|
|
104
|
+
get_target_property(_imp "${_tgt}" IMPORTED_IMPLIB)
|
|
105
|
+
if(NOT _imp)
|
|
106
|
+
get_target_property(_imp "${_tgt}" IMPORTED_IMPLIB_RELEASE)
|
|
107
|
+
endif()
|
|
108
|
+
if(_imp)
|
|
109
|
+
install(FILES "${_imp}" DESTINATION "${_dest}")
|
|
110
|
+
endif()
|
|
111
|
+
endif()
|
|
112
|
+
endforeach()
|
|
113
|
+
endif()
|
openswmm/__init__.py
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"""
|
|
2
|
+
openswmm -- Python bindings for the OpenSWMM stormwater modelling engine.
|
|
3
|
+
|
|
4
|
+
:author: Caleb Buahin
|
|
5
|
+
:copyright: Copyright (c) 2026 Caleb Buahin
|
|
6
|
+
:license: MIT
|
|
7
|
+
|
|
8
|
+
Subpackages
|
|
9
|
+
-----------
|
|
10
|
+
legacy.engine
|
|
11
|
+
Legacy EPA SWMM 5.x solver bindings (Cython).
|
|
12
|
+
legacy.output
|
|
13
|
+
Legacy EPA SWMM 5.x binary output reader (Cython).
|
|
14
|
+
engine
|
|
15
|
+
New data-oriented engine 6.x bindings (Cython).
|
|
16
|
+
|
|
17
|
+
This top-level package additionally:
|
|
18
|
+
|
|
19
|
+
- Configures the platform-specific shared-library search path so the
|
|
20
|
+
bundled C/C++ shared libraries can be located by the dynamic linker.
|
|
21
|
+
- Resolves the package version string into ``__version__``.
|
|
22
|
+
- Re-exports the legacy engine and legacy output public symbols when
|
|
23
|
+
their compiled Cython extensions are available, for backward
|
|
24
|
+
compatibility with pre-6.x callers.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# start delvewheel patch
|
|
29
|
+
def _delvewheel_patch_1_12_1():
|
|
30
|
+
import os
|
|
31
|
+
if os.path.isdir(libs_dir := os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'openswmm.libs'))):
|
|
32
|
+
os.add_dll_directory(libs_dir)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
_delvewheel_patch_1_12_1()
|
|
36
|
+
del _delvewheel_patch_1_12_1
|
|
37
|
+
# end delvewheel patch
|
|
38
|
+
|
|
39
|
+
import importlib.metadata
|
|
40
|
+
import os
|
|
41
|
+
import platform
|
|
42
|
+
|
|
43
|
+
# ---------------------------------------------------------------------------
|
|
44
|
+
# Windows DLL search path
|
|
45
|
+
#
|
|
46
|
+
# On macOS and Linux the Cython extensions embed @loader_path / $ORIGIN
|
|
47
|
+
# RPATH entries pointing at the directory where the bundled dylib/so lives,
|
|
48
|
+
# so the dynamic linker finds it automatically — no extra path configuration
|
|
49
|
+
# is required.
|
|
50
|
+
#
|
|
51
|
+
# On Windows, Python 3.8+ requires explicit DLL directories because the
|
|
52
|
+
# old LoadLibrary PATH search was disabled. The bundled .dll files live
|
|
53
|
+
# alongside the Cython .pyd extensions under openswmm/engine/ and
|
|
54
|
+
# openswmm/legacy/{engine,output}/ — NOT in sys.prefix/bin. Register each
|
|
55
|
+
# subpackage directory so Python can find all bundled DLLs regardless of
|
|
56
|
+
# which module is imported first.
|
|
57
|
+
# ---------------------------------------------------------------------------
|
|
58
|
+
if platform.system() == "Windows" and hasattr(os, "add_dll_directory"):
|
|
59
|
+
_pkg_dir = os.path.dirname(__file__)
|
|
60
|
+
for _dll_subdir in (
|
|
61
|
+
os.path.join(_pkg_dir, "engine"),
|
|
62
|
+
os.path.join(_pkg_dir, "legacy", "engine"),
|
|
63
|
+
os.path.join(_pkg_dir, "legacy", "output"),
|
|
64
|
+
):
|
|
65
|
+
if os.path.isdir(_dll_subdir):
|
|
66
|
+
os.add_dll_directory(_dll_subdir)
|
|
67
|
+
|
|
68
|
+
# ---------------------------------------------------------------------------
|
|
69
|
+
# Version
|
|
70
|
+
# ---------------------------------------------------------------------------
|
|
71
|
+
try:
|
|
72
|
+
__version__: str = importlib.metadata.version("openswmm")
|
|
73
|
+
except importlib.metadata.PackageNotFoundError:
|
|
74
|
+
__version__ = "0.0.0.dev0"
|
|
75
|
+
|
|
76
|
+
# ---------------------------------------------------------------------------
|
|
77
|
+
# Public re-exports (legacy subpackages)
|
|
78
|
+
#
|
|
79
|
+
# These require compiled Cython extensions (.so/.pyd). When building
|
|
80
|
+
# documentation or in a partial install the extensions may not be available,
|
|
81
|
+
# so we import them conditionally.
|
|
82
|
+
# ---------------------------------------------------------------------------
|
|
83
|
+
try:
|
|
84
|
+
from openswmm.legacy.engine import * # noqa: F401,F403
|
|
85
|
+
except ImportError:
|
|
86
|
+
pass
|
|
87
|
+
|
|
88
|
+
try:
|
|
89
|
+
from openswmm.legacy.output import * # noqa: F401,F403
|
|
90
|
+
except ImportError:
|
|
91
|
+
pass
|
|
92
|
+
|
|
93
|
+
__all__ = ["__version__"]
|
|
File without changes
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# ============================================================================
|
|
2
|
+
# openswmm.engine — Cython bindings for the OpenSWMM 6.x C API.
|
|
3
|
+
#
|
|
4
|
+
# Every extension is built through add_cython_extension() (see
|
|
5
|
+
# python/cmake/CythonHelpers.cmake) so directives, RPATH, visibility,
|
|
6
|
+
# symbol export, and install rules stay uniform across modules.
|
|
7
|
+
#
|
|
8
|
+
# CMake target names carry an "engine_" prefix to avoid collisions with the
|
|
9
|
+
# identically-named legacy modules (legacy/engine/_solver.pyx, etc.). The
|
|
10
|
+
# helper sets OUTPUT_NAME so the on-disk filename remains the bare module
|
|
11
|
+
# name and Python imports resolve correctly.
|
|
12
|
+
# ============================================================================
|
|
13
|
+
|
|
14
|
+
set(_engine_modules
|
|
15
|
+
_solver
|
|
16
|
+
_model
|
|
17
|
+
_edit
|
|
18
|
+
_nodes
|
|
19
|
+
_links
|
|
20
|
+
_subcatchments
|
|
21
|
+
_gages
|
|
22
|
+
_hotstart
|
|
23
|
+
_massbalance
|
|
24
|
+
_pollutants
|
|
25
|
+
_tables
|
|
26
|
+
_inflows
|
|
27
|
+
_controls
|
|
28
|
+
_infrastructure
|
|
29
|
+
_quality
|
|
30
|
+
_statistics
|
|
31
|
+
_output_reader
|
|
32
|
+
_spatial
|
|
33
|
+
_forcing
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
foreach(_mod IN LISTS _engine_modules)
|
|
37
|
+
add_cython_extension(
|
|
38
|
+
NAME ${_mod}
|
|
39
|
+
TARGET engine_${_mod}
|
|
40
|
+
SOURCE ${_mod}.pyx
|
|
41
|
+
INSTALL_DIR openswmm/engine
|
|
42
|
+
LIBS openswmm::engine
|
|
43
|
+
)
|
|
44
|
+
endforeach()
|
|
45
|
+
|
|
46
|
+
# Optional 2-D module (requires SUNDIALS/CVODE; off by default).
|
|
47
|
+
if(OPENSWMM_BUILD_2D)
|
|
48
|
+
add_cython_extension(
|
|
49
|
+
NAME _2d
|
|
50
|
+
TARGET engine__2d
|
|
51
|
+
SOURCE _2d.pyx
|
|
52
|
+
INSTALL_DIR openswmm/engine
|
|
53
|
+
LIBS openswmm::engine
|
|
54
|
+
)
|
|
55
|
+
endif()
|
|
56
|
+
|
|
57
|
+
# GeoPackage support is optional — built only when the engine target was
|
|
58
|
+
# configured with OPENSWMM_WITH_GEOPACKAGE. When omitted, openswmm.engine
|
|
59
|
+
# imports HAS_GEOPACKAGE = False at runtime (see __init__.py).
|
|
60
|
+
if(OPENSWMM_WITH_GEOPACKAGE)
|
|
61
|
+
add_cython_extension(
|
|
62
|
+
NAME _geopackage
|
|
63
|
+
TARGET engine__geopackage
|
|
64
|
+
SOURCE _geopackage.pyx
|
|
65
|
+
INSTALL_DIR openswmm/engine
|
|
66
|
+
LIBS openswmm::engine
|
|
67
|
+
)
|
|
68
|
+
endif()
|
|
Binary file
|
openswmm/engine/_2d.pxd
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# _2d.pxd — Cython declarations for the 2D surface routing C API.
|
|
2
|
+
#
|
|
3
|
+
# These declarations allow Cython modules to call the C functions in
|
|
4
|
+
# openswmm_2d.h without an intermediate Python layer.
|
|
5
|
+
|
|
6
|
+
cdef extern from "openswmm_2d.h":
|
|
7
|
+
# Status
|
|
8
|
+
int swmm_2d_is_active(void* engine, int* active)
|
|
9
|
+
|
|
10
|
+
# Mesh geometry
|
|
11
|
+
int swmm_2d_vertex_count(void* engine, int* count)
|
|
12
|
+
int swmm_2d_triangle_count(void* engine, int* count)
|
|
13
|
+
int swmm_2d_vertex_get_xyz(void* engine, int idx,
|
|
14
|
+
double* x, double* y, double* z)
|
|
15
|
+
int swmm_2d_vertex_get_xyz_bulk(void* engine,
|
|
16
|
+
double* x, double* y, double* z) nogil
|
|
17
|
+
int swmm_2d_set_vertex_z(void* engine, int idx, double z)
|
|
18
|
+
int swmm_2d_triangle_get_vertices(void* engine, int idx,
|
|
19
|
+
int* v0, int* v1, int* v2)
|
|
20
|
+
int swmm_2d_triangle_get_area(void* engine, int idx, double* area)
|
|
21
|
+
int swmm_2d_triangle_get_centroid(void* engine, int idx,
|
|
22
|
+
double* cx, double* cy, double* cz)
|
|
23
|
+
int swmm_2d_triangle_get_mannings(void* engine, int idx, double* n)
|
|
24
|
+
int swmm_2d_triangle_get_neighbours(void* engine, int idx,
|
|
25
|
+
int* n0, int* n1, int* n2)
|
|
26
|
+
int swmm_2d_edge_get_geometry_bulk(void* engine,
|
|
27
|
+
double* length, double* nx, double* ny) nogil
|
|
28
|
+
|
|
29
|
+
# Coupling
|
|
30
|
+
int swmm_2d_vertex_coupling_count(void* engine, int* count)
|
|
31
|
+
int swmm_2d_triangle_coupling_count(void* engine, int* count)
|
|
32
|
+
int swmm_2d_vertex_get_coupled_node(void* engine, int vidx, int* nidx)
|
|
33
|
+
int swmm_2d_triangle_get_coupled_node(void* engine, int tidx, int* nidx)
|
|
34
|
+
|
|
35
|
+
# State — per triangle
|
|
36
|
+
int swmm_2d_get_depth(void* engine, int idx, double* depth)
|
|
37
|
+
int swmm_2d_get_head(void* engine, int idx, double* head)
|
|
38
|
+
int swmm_2d_get_coupling_flux(void* engine, int idx, double* flux)
|
|
39
|
+
int swmm_2d_get_rainfall(void* engine, int idx, double* rainfall)
|
|
40
|
+
int swmm_2d_get_net_source(void* engine, int idx, double* net_source)
|
|
41
|
+
int swmm_2d_get_depths_bulk(void* engine, double* depths) nogil
|
|
42
|
+
int swmm_2d_get_heads_bulk(void* engine, double* heads) nogil
|
|
43
|
+
int swmm_2d_get_coupling_fluxes_bulk(void* engine, double* fluxes) nogil
|
|
44
|
+
int swmm_2d_get_edge_flux_bulk(void* engine, double* flux) nogil
|
|
45
|
+
|
|
46
|
+
# State — per vertex
|
|
47
|
+
int swmm_2d_vertex_get_head(void* engine, int idx, double* head)
|
|
48
|
+
int swmm_2d_vertex_get_heads_bulk(void* engine, double* heads) nogil
|
|
49
|
+
|
|
50
|
+
# Statistics
|
|
51
|
+
int swmm_2d_get_max_depth(void* engine, double* max_depth)
|
|
52
|
+
int swmm_2d_get_total_volume(void* engine, double* volume)
|
|
53
|
+
int swmm_2d_get_total_exchange_flow(void* engine, double* flow)
|
|
54
|
+
int swmm_2d_get_cvode_steps(void* engine, long* steps)
|
|
55
|
+
int swmm_2d_get_cvode_last_step(void* engine, double* h_last)
|
|
56
|
+
int swmm_2d_get_stat_max_depths(void* engine, double* max_depths)
|
|
57
|
+
|
|
58
|
+
# Forcing
|
|
59
|
+
int swmm_2d_force_rainfall(void* engine, int idx,
|
|
60
|
+
double value, int mode, int persist)
|
|
61
|
+
int swmm_2d_force_rainfall_uniform(void* engine,
|
|
62
|
+
double value, int mode, int persist)
|
|
63
|
+
int swmm_2d_force_coupling_flux(void* engine, int idx,
|
|
64
|
+
double value, int mode, int persist)
|
|
65
|
+
int swmm_2d_force_clear_all(void* engine)
|
|
66
|
+
|
|
67
|
+
# Options
|
|
68
|
+
int swmm_2d_get_dry_depth(void* engine, double* dry_depth)
|
|
69
|
+
int swmm_2d_set_dry_depth(void* engine, double dry_depth)
|
|
70
|
+
int swmm_2d_get_rel_tolerance(void* engine, double* rtol)
|
|
71
|
+
int swmm_2d_set_rel_tolerance(void* engine, double rtol)
|
|
72
|
+
int swmm_2d_get_abs_tolerance(void* engine, double* atol)
|
|
73
|
+
int swmm_2d_set_abs_tolerance(void* engine, double atol)
|
|
74
|
+
|
|
75
|
+
# Boundary edges
|
|
76
|
+
int swmm_2d_boundary_edge_count(void* engine, int* count)
|
|
77
|
+
int swmm_2d_get_edge_bc_type(void* engine, int tri_idx, int edge, int* bc_type)
|
|
78
|
+
int swmm_2d_set_edge_bc_type(void* engine, int tri_idx, int edge, int bc_type)
|
|
79
|
+
int swmm_2d_get_edge_bc_head(void* engine, int tri_idx, int edge, double* head)
|
|
80
|
+
int swmm_2d_set_edge_bc_head(void* engine, int tri_idx, int edge, double head)
|
|
81
|
+
int swmm_2d_get_edge_bc_slope(void* engine, int tri_idx, int edge, double* slope)
|
|
82
|
+
int swmm_2d_set_edge_bc_slope(void* engine, int tri_idx, int edge, double slope)
|
|
83
|
+
int swmm_2d_get_edge_bc_cum_flux(void* engine, int tri_idx, int edge, double* cum_flux)
|