Skip to content

Missing model_settings arguments for estimator #650

@bwentl

Description

@bwentl

In transit_pass_ownership, transit_pass_subsidy, telecommute_frequency, and work_from_home, model_settings is not included in the call for estimator.write_coefficients. This results in an AssertionError when running these models with estimation mode enabled.

Error traceback with activitysim v1.2.0:

INFO - Initialize Estimator for'work_from_home'
DEBUG - work_from_home: estimate.write_spec: output\estimation_data_bundle\work_from_home\work_from_home_SPEC.csv
INFO - Time to execute all models until this error : 150.854 seconds (2.5 minutes)
ERROR - activitysim run encountered an unrecoverable error
Traceback (most recent call last):
  File "C:\Users\bwen\Miniconda3\envs\abm_dev\lib\site-packages\activitysim\cli\run.py", line 354, in run
    pipeline.run(
  File "C:\Users\bwen\Miniconda3\envs\abm_dev\lib\site-packages\activitysim\core\pipeline.py", line 691, in run
    run_model(model)
  File "C:\Users\bwen\Miniconda3\envs\abm_dev\lib\site-packages\activitysim\core\pipeline.py", line 529, in run_model
    orca.run([step_name])
  File "C:\Users\bwen\Miniconda3\envs\abm_dev\lib\site-packages\orca\orca.py", line 2177, in run
    step()
  File "C:\Users\bwen\Miniconda3\envs\abm_dev\lib\site-packages\orca\orca.py", line 973, in __call__
    return self._func(**kwargs)
  File "C:\Users\bwen\Miniconda3\envs\abm_dev\lib\site-packages\activitysim\abm\models\work_from_home.py", line 61, in work_from_home
    estimator.write_coefficients(coefficients_df)
  File "C:\Users\bwen\Miniconda3\envs\abm_dev\lib\site-packages\activitysim\abm\models\util\estimation.py", line 277, in write_coefficients
    assert file_name is not None
AssertionError

The fix should be quite simple by adding model_settings to calls with estimator.write_coefficients. For example, this error does not occur for auto_ownership if estimator.write_coefficients is used properly:

estimator.write_coefficients(coefficients_df, model_settings)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions