Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shadow_pricing.yaml required when work and school location models aren't being run. #918

Open
JoeJimFlood opened this issue Dec 18, 2024 · 0 comments
Labels
Bug Something isn't working/bug f

Comments

@JoeJimFlood
Copy link
Contributor

Describe the bug
SANDAG's visitor and airport access models do not run work or school location as the former is for non-residents of San Diego spending the day in the area and the latter is just for trips to or from the airports. However, the recent 1.3 upgrade requires that a shadow_pricing.yaml file be present even if no model components using shadow pricing are being run. Adding blank shadow_pricing.yaml files to configs is a sufficient workaround, but this is not ideal.

I suspect that adding a conditional statement to check if work or school location is being run before this block of code would fix the issue, but I won't be able to test this for a few weeks.

To Reproduce
Steps to reproduce the behavior:

  1. Set up an ActivitySim model that does not include work or school location in the model steps.
  2. Ensure that there is no file called "shadow_pricing.yaml" in the configs.
  3. Run the model. It should crash early on due to the file not being there.

Expected behavior
If work and school location are both not being run, then the model should work if there is no shadow_pricing.yaml file as it is not needed.

Screenshots
Error message with traceback:

Traceback (most recent call last):
  File "\\JUPITER\ABM\user\jflo\repos\asim132\activitysim\cli\run.py", line 388, in run
    mp_tasks.run_multiprocess(state, injectables)
  File "\\JUPITER\ABM\user\jflo\repos\asim132\activitysim\core\mp_tasks.py", line 1634, in run_multiprocess
    shared_data_buffers.update(allocate_shared_shadow_pricing_buffers(state))
  File "\\JUPITER\ABM\user\jflo\repos\asim132\activitysim\core\mp_tasks.py", line 1234, in allocate_shared_shadow_pricing_buffers
    shadow_pricing_info = state.get_injectable("shadow_pricing_info", None)
  File "\\JUPITER\ABM\user\jflo\repos\asim132\activitysim\core\workflow\state.py", line 791, in get
    result = self._LOADABLE_OBJECTS[key](self._context)
  File "\\JUPITER\ABM\user\jflo\repos\asim132\activitysim\core\workflow\steps.py", line 367, in run_step
    outcome = error_logging(wrapped_func)(state, *args, **kwargs)
  File "\\JUPITER\ABM\user\jflo\repos\asim132\activitysim\core\workflow\steps.py", line 46, in wrapper
    return func(*args, **kwargs)
  File "\\JUPITER\ABM\user\jflo\repos\asim132\activitysim\abm\tables\shadow_pricing.py", line 1546, in shadow_pricing_info
    return get_shadow_pricing_info(state)
  File "\\JUPITER\ABM\user\jflo\repos\asim132\activitysim\abm\tables\shadow_pricing.py", line 1465, in get_shadow_pricing_info
    shadow_settings = ShadowPriceSettings.read_settings_file(
  File "\\JUPITER\ABM\user\jflo\repos\asim132\activitysim\core\configuration\base.py", line 98, in read_settings_file
    return filesystem.read_settings_file(
  File "\\JUPITER\ABM\user\jflo\repos\asim132\activitysim\core\configuration\filesystem.py", line 824, in read_settings_file
    raise SettingsFileNotFoundError(file_name, configs_dir_list)
activitysim.core.exceptions.SettingsFileNotFoundError: "Settings file 'shadow_pricing.yaml' not found in (WindowsPath('abm/src/asim/configs/visitor'), WindowsPath('abm/src/asim/configs/common'))"
@JoeJimFlood JoeJimFlood added the Bug Something isn't working/bug f label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working/bug f
Projects
None yet
Development

No branches or pull requests

1 participant