Skip to content

Conversation

@i-am-sijia
Copy link
Contributor

This pull request substantially revises and expands the documentation for installing and setting up ActivitySim using the UV package and project manager. The changes clarify recommended installation methods for different user types, provide detailed step-by-step instructions for installing UV and ActivitySim (both from PyPI and from source with a lockfile), and introduce a comprehensive Q&A section to address common user scenarios and troubleshooting.

Expanded and Detailed UV Installation Instructions

  • Added step-by-step instructions for installing UV on Windows (including user and global installs), updating PATH, and verifying installation, with links to official resources.

Comprehensive ActivitySim Installation Options Guidance and User Recommendations

  • Provided thorough instructions for installing ActivitySim using UV both from PyPI and from source with a lockfile, including explanations of the implications for dependency management and reproducibility.
  • Clarified which installation method is recommended for different users, specifying criteria such as familiarity with Python, need to customize code, and management of virtual environments.
  • Added a comparison table to help users choose between installation options based on their needs (official release, development, reproducibility, etc.).

New Q&A Section for Common User Scenarios

  • Introduced a Q&A section addressing how to add additional packages, manage conflicting dependencies, share working environments, handle dependency issues, and clarify when to activate virtual environments versus using uv run.

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 PR reorganizes and expands the UV Package and Project Manager installation documentation for ActivitySim. The documentation is restructured to provide clearer guidance on installation options and includes more detailed instructions for Windows users.

  • Reorganized UV installation section with clearer subsections and step-by-step instructions
  • Added detailed Windows-specific UV installation instructions with PowerShell commands
  • Expanded Option 1 (From PyPI) and Option 2 (From Source with Lockfile) with more context and clarification
  • Added new Common Q&A section to address frequently asked questions about UV usage

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

@jpn--
Copy link
Member

jpn-- commented Nov 3, 2025

Do we want to consider recommending locking uv on a script file for model application use? An example is here. I'm not sure if this is easier or harder for an agency application.

@jpn-- jpn-- moved this to Tasked in Phase 11 Nov 6, 2025
@jpn-- jpn-- added this to Phase 11 Nov 6, 2025
@i-am-sijia
Copy link
Contributor Author

@jpn-- my understanding is that uv lock --script one_single_script.py is a minimal set up, is fast, but is limited to single scripts (what happens if agencies have multiple scripts?). Is there any additional benefit compared to just setting up a UV project/environment in the normal way? The locking process is not fundamentally different than setting up a UV project/environment so I am open to be convinced either way. Some online posts suggest: "for model applications, use script locking for exploration/prototyping, transition to full project when moving to production or when complexity grows."

copy path\to\shared\uv.lock .

# Recreate the same environment
uv sync --locked
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest we add an additional Question here: "Can other users on the same server or machine use my already created virtual environment?"
My understanding is the answer is: "No. When UV installs the dependencies, paths are created specific to the user. As such, if another user tries to activate your virtual environment, that environment will not work for them."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The answer is Yes, but it requires admin rights and additional setup. I added it to the Q&A and provided some instructions. SANDAG was able to do this. I haven't tested it myself because I do not have admin rights on WSP machines. I think we should advise "This is doable but we do not recommend it. We recommend sharing the lockfile and uv sync"

Copy link
Member

Choose a reason for hiding this comment

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

I think what @i-am-sijia wrote in this version of the docs is fine. If I were writing it I'd write it in an even more strongly worded manner; an ideal use case is a fully containerized environment where ActivitySim runs in a way where no other user and no other process can interfere with it.

@i-am-sijia i-am-sijia marked this pull request as ready for review November 7, 2025 21:27
@jpn-- jpn-- merged commit ed44a40 into ActivitySim:main Nov 11, 2025
20 of 30 checks passed
@github-project-automation github-project-automation bot moved this from Tasked to Done in Phase 11 Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Develop and test robust, multi-platform UV-based installation for v1.4.x and 1.5.x

3 participants