feat: add swmm_NODE_OUTFLOW to legacy and Python bindings#85
Merged
Conversation
Under Python 3.12 + numpy 2.4.6 the type-arg and operator errors that this # type: ignore was suppressing are no longer raised, so mypy strict mode reports the comment as unused and fails the typing workflow. Remove it. Signed-off-by: cbuahin <caleb.buahin@gmail.com>
node_series, link_series, subcatchment_series and system_series unpacked self._series_range() into bare s, e, leaving them as Python objects. Passing them to the swmm_output_get_*_series() C call inside 'with nogil:' then failed with 'Coercion from Python not allowed without the GIL', breaking the wheel build on every macOS and Windows runner. Declare s and e as cdef int before the unpack so Cython coerces directly into C ints and the no-GIL call type-checks. Signed-off-by: cbuahin <caleb.buahin@gmail.com>
cibuildwheel's manylinux Linux builds were failing in Cythonize steps that ran right after openswmm/engine/_datetime.cpython-3??-*-linux-gnu.so was linked into ninja's cwd. 'python -m cython' puts cwd on sys.path[0], so CPython's datetime.py 'from _datetime import *' picked up our SWMM _datetime module instead of the stdlib accelerator. The cleanup block then deleted _check_date_fields (cp310) / 'datetime' (cp312) from datetime's namespace, breaking every subsequent datetime use during Cython's own import of xml.sax.saxutils -> calendar -> datetime. Set WORKING_DIRECTORY on the Cython add_custom_command to the per-target cython_gen/<target> folder, which only ever holds generated .cxx output and contains no importable top-level names. macOS / Windows weren't affected because their build ordering happens to cythonize the offending .pyx files before _datetime.so is linked, but the same race could bite on those platforms in different builds. Signed-off-by: cbuahin <caleb.buahin@gmail.com>
Copilot
AI
changed the title
[WIP] Support for 'outflow' value in getNodeValue method
Add swmm_NODE_OUTFLOW support to getNodeValue API
May 28, 2026
Member
|
@copilot , the pull request should be going into develop. |
Author
I've updated the PR base branch to target |
Copilot
AI
force-pushed
the
copilot/swmm6-rel-support-outflow-value
branch
from
May 28, 2026 16:42
5f5e1ac to
4b5800f
Compare
Add swmm_NODE_OUTFLOW enum value to swmm_NodeProperty and handle it in getNodeValue() to return node->outflow converted to user flow units. The refactored engine already exposes this via swmm_node_get_outflow(). This change brings the legacy engine to parity. Resolves support for 'outflow' value in getNodeValue method. Ref: USEPA#168
Copilot
AI
changed the title
Add swmm_NODE_OUTFLOW support to getNodeValue API
feat(legacy): add swmm_NODE_OUTFLOW to getNodeValue API
May 28, 2026
Member
|
@copilot , I want to make sure the python bindings both legacy and refactored surface this new variable with relevant unit tests. |
Author
Done in commit Changes made:
|
Copilot
AI
changed the title
feat(legacy): add swmm_NODE_OUTFLOW to getNodeValue API
feat: add swmm_NODE_OUTFLOW to legacy and Python bindings
May 28, 2026
|
I’ve been running my own build with this feature for a while—really excited to see it officially supported now. Thanks for pushing this forward. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The legacy engine's
getNodeValueAPI had no way to queryNode.outflow(total outflow through downstream links), despite the field existing on the struct. The refactored engine already exposes this viaswmm_node_get_outflow(). This brings the legacy API and both Python binding layers to parity.Changes
C/Legacy engine:
swmm_NODE_OUTFLOWenum value toswmm_NodePropertyinopenswmm_solver.hgetNodeValue()returningnode->outflow * UCF(FLOW)Legacy Python bindings:
swmm_NODE_OUTFLOWto Cython.pxddeclaration (solver.pxd)SWMMNodeProperties.OUTFLOWenum member in_solver.pyxand_solver.pyioutflowproperty toLegacyNodewrapper in_nodes.pyRefactored Python bindings:
Node.outflowproperty) — added dedicated unit testTests:
test_get_node_outflow(rawget_valueAPI),test_read_outflow_during_sim, andtest_outflow_via_get_value(OOP wrapper)test_outflow_propertyintest_nodes_pythonic.pyUsage
Notes
swmm6_relintodevelopas requested.