Skip to content

Dev series compare#163

Merged
michaeltryby merged 4 commits intodevfrom
dev-series-compare
Feb 11, 2026
Merged

Dev series compare#163
michaeltryby merged 4 commits intodevfrom
dev-series-compare

Conversation

@michaeltryby
Copy link
Collaborator

This pull request introduces enhancements to the SWMM Toolkit Python bindings, focusing on improved date/time handling and series alignment between solver and output modules. The main changes include new functions for date/time extraction and decoding, expanded SWIG typemaps for date components, and comprehensive tests to ensure correctness and alignment of time series data.

Date/Time Handling Improvements:

  • Added new functions to extract date/time information (get_date_time, get_date_series) and decode date components (decode_date) in the SWIG interface and renamed them for Python API clarity. [1] [2]
  • Expanded SWIG typemaps to support individual date/time components (year, month, day, hour, minute, second, dayOfWeek) and proper memory management for double arrays. [1] [2]
  • Enabled exception-free handling for SMO_decodeDate in the SWIG interface.

Testing and Validation:

  • Added new tests in test_output.py for date/time extraction, date series, and date decoding, validating monotonicity, spacing, and plausibility of decoded components.
  • Introduced test_series.py to compare time-aligned solver and output series, ensuring matching time axes and values within tolerance using custom decimal digit checks.

Submodule Update:

  • Updated the SWMM solver submodule to a newer commit, potentially bringing upstream improvements.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the SWMM Toolkit Python bindings with improved date/time handling capabilities and validates alignment between solver and output module time series. The changes enable extraction of date/time information from output files and ensure that solver and output modules produce consistent time-aligned results.

Changes:

  • Added Python API functions (get_date_time, get_date_series, decode_date) with corresponding SWIG interface definitions and typemaps for date/time component extraction
  • Introduced comprehensive tests validating date/time operations, time series monotonicity, and solver-output alignment with custom decimal digit accuracy checks
  • Updated SWMM solver submodule to bring in upstream improvements

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
swmm-toolkit/tests/test_series.py New test file comparing time-aligned solver and output series using custom decimal digit checks
swmm-toolkit/tests/test_output.py Added tests for date/time extraction, date series, and date decoding with validation of monotonicity and component plausibility
swmm-toolkit/swmm-solver Updated submodule commit reference
swmm-toolkit/src/swmm/toolkit/output_rename.i Added Python API name mappings for new date/time functions
swmm-toolkit/src/swmm/toolkit/output.i Extended SWIG typemaps for date components and double arrays, disabled exception handling for decode_date

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@michaeltryby michaeltryby merged commit caaab45 into dev Feb 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants