Skip to content

Conversation

@jpn--
Copy link
Member

@jpn-- jpn-- commented Oct 31, 2025

This pull request introduces improvements to error handling and logging in the trip destination model and skim wrapper setup, as well as an update to the minimum required version of the sharrow dependency. The main focus is on providing more informative error messages and warnings to help diagnose configuration issues, particularly when using sharrow optimizations.

Note: nothing in this PR is actually needed to solve problems with the SANDAG example running with sharrow -- all the problems are solved by the bug fix in the sharrow 2.15 update. This PR simply requires we use that fixed dependency, and adds notes about what needs to be done in models when they are not set up correctly for sharrow.

Error handling and logging improvements:

  • Added a try-except block around the trip destination choice logic in run_trip_destination to catch KeyError when purpose_index_num is missing, logging a detailed error message to guide users on the required configuration for sharrow-optimized runs. [1] [2]
  • Enhanced the set_skim_wrapper_targets function to optionally allow partial success when setting dataframe targets for skims. Now, assertion errors caused by missing required keys are collected and logged as warnings instead of always raising exceptions, improving robustness and debuggability. [1] [2]

Dependency update:

  • Increased the minimum required version of the sharrow package from 2.9.1 to 2.15 in pyproject.toml, ensuring compatibility with recent features and fixes.

@jpn-- jpn-- requested a review from Copilot October 31, 2025 18:13
Copy link
Contributor

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 pull request upgrades the sharrow dependency from version 2.9.1 to 2.15.0 and adds enhanced error handling for sharrow-related issues. The changes include better handling of AssertionErrors when setting skim wrapper targets, improved error messages for missing purpose_index_num configuration, and an optional parameter to control error strictness.

  • Updated sharrow minimum version requirement from 2.9.1 to 2.15.0
  • Added error handling and informative error messages for trip destination model configuration issues
  • Enhanced set_skim_wrapper_targets with optional error suppression and warning logging

Reviewed Changes

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

File Description
uv.lock Updated sharrow package from version 2.14.0 to 2.15.0 with new hashes and reduced revision number
pyproject.toml Bumped sharrow minimum version requirement from >=2.9.1 to >=2.15
activitysim/core/simulate.py Added allow_partial_success parameter to set_skim_wrapper_targets with AssertionError handling and warning logging
activitysim/abm/models/trip_destination.py Added try-except block to catch and provide helpful error message for missing purpose_index_num configuration

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

@jpn-- jpn-- requested a review from i-am-sijia October 31, 2025 18:47
Copy link
Contributor

@i-am-sijia i-am-sijia left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@jpn-- jpn-- merged commit 7e5202e into ActivitySim:main Nov 12, 2025
19 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