Skip to content

'utility not aligned' error when running sharrow in test mode using uv, but not in conda using same version of Activitysim. #1022

@stefancoe

Description

@stefancoe

Describe the bug
This is an odd one. When running sharrow in test mode with a uv environment, I get a 'utility not aligned' error here, but not when running the same version of activitysim using anaconda. I did some debugging and the utilities that are causing the issue are coming from the bike and walk tour mode choice utilities when getting logsums during mandatory_tour_scheduling step, so perhaps this has something to do with the maz_to_maz skims. When using the anaconda env, the utilities from variables utilities and sh_util are aligned. Interestingly, when switching to an older version of Activitysim the bug turned up sooner in the disaggregate accessibilities step. I tested this against an older anaconda environment and a new one. For the new one, I first created the environment and then ran "pip install -e" from the (cloned) activitysim directory. This essentially installed activitysim in editable mode and then all of its dependencies using pip.

To Reproduce
Steps to reproduce the behavior:

  1. Copy conifgs and input data from here.
  2. Clone Activitysim
  3. Open a command prompt, cd to Activitysim, then enter uv sync --locked to create the uv .venv.
  4. Enter .venv\Scripts\activate to activate the uv environment.
  5. Enter activitysim run -c path_to_configs_sh_compile -c path_to_configs_dev -d path_to_data_test -o path_to_output
  6. The model should crash during mandatory tour scheduling.
  7. Create a new anaconda env by using the environment.yml file in the google drive linked above or by creating a new env and then running pip install -e in the activitysim root dir.
  8. Run the model using the anaconda env using the same arguments as above.
  9. The model should not crash.

Additional context
This is probably a library version issue and not anaconda/uv issue. Either way it will be good to know why the utilities are different running one way and not the other.

Metadata

Metadata

Assignees

Labels

BugSomething isn't working/bug f

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions