Skip to content

Updates for numpy v2#19

Open
jpn-- wants to merge 3 commits into
ActivitySim:extendedfrom
driftlesslabs:numpy-2
Open

Updates for numpy v2#19
jpn-- wants to merge 3 commits into
ActivitySim:extendedfrom
driftlesslabs:numpy-2

Conversation

@jpn--

@jpn-- jpn-- commented Jun 23, 2026

Copy link
Copy Markdown
Member

This pull request introduces two new scripts for running the MTC example model with Sharrow enabled and updates several core dependencies to more current versions. The changes improve reproducibility, simplify environment setup, and modernize dependency requirements.

New scripts for Sharrow-enabled model runs:

  • Added scripts/run-large-sharrow.py, a script to run the MTC model on the full dataset with Sharrow enabled. It includes metadata for running with uv, handles downloading required data, and configures a large sample size.
  • Added scripts/run-small-sharrow.py, a script for running the MTC model on a small test sample with Sharrow enabled, also supporting execution via uv.

Dependency updates in pyproject.toml:

  • Updated activitysim to remove version pinning, allowing the latest version to be used.
  • Updated numpy requirement to >=2,<3 for compatibility with newer releases.
  • Updated pandera requirement to >=0.30 to support newer features and fixes.

Copilot AI left a comment

Copy link
Copy Markdown

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 modernizes the project’s Python dependency stack (notably moving to NumPy v2) and adds two uv-runnable scripts to run the Prototype MTC model with Sharrow enabled, improving ease of execution and reproducibility via a lockfile.

Changes:

  • Updated core dependencies to newer versions (including numpy>=2,<3, newer pandera, and a newer ActivitySim via a git source override).
  • Added scripts/run-small-sharrow.py and scripts/run-large-sharrow.py for Sharrow-enabled runs (the large script also downloads/unpacks the full dataset).
  • Updated environment defaults/ignores (Python version set to 3.10; ignore data_full/ in git).

Reviewed changes

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

Show a summary per file
File Description
uv.lock Locks updated dependency set (NumPy v2 ecosystem, ActivitySim from git, Sharrow 2.15.0, etc.) for reproducible installs.
pyproject.toml Updates declared requirements (NumPy v2, newer Pandera) and configures ActivitySim to come from the git main branch via tool.uv.sources.
scripts/run-small-sharrow.py New uv script to run a small-sample Sharrow-enabled model run.
scripts/run-large-sharrow.py New uv script to download/unpack full data and run a large-sample Sharrow-enabled model run.
.python-version Sets default local Python version to 3.10 (within project’s >=3.10,<3.12 constraint).
.gitignore Ensures data_full/ is ignored by git.

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

Comment on lines +14 to +18
Run the MTC example model with sharrow enabled, on the small test sample.

The metadata in the header above allows this script to be run with `uv` without
needing to set up a separate virtual environment or install dependencies manually.
"""
import platformdirs
import activitysim.abm # register components # noqa: F401
from activitysim.core import workflow
from activitysim.examples.external import download_external_example, download_asset
Comment on lines +57 to +61
# do not allow full data to enter Git repo
working_dir.joinpath(".gitignore").write_text("**\n")

out_dir = Path(str(__file__).replace(".py", "-output"))
out_dir.mkdir(exist_ok=True)
Comment on lines +51 to +55
sha256 = "b402506a61055e2d38621416dd9a5c7e3cf7517c0a9ae5869f6d760c03284ef3",
link = Path(platformdirs.user_cache_dir(appname="ActivitySim")) / "External-Data",
base_path=str(working_dir),
unpack = "data_full",
)
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