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

Missing model_settings arguments for estimator #650

Closed
bwentl opened this issue Feb 8, 2023 · 1 comment
Closed

Missing model_settings arguments for estimator #650

bwentl opened this issue Feb 8, 2023 · 1 comment

Comments

@bwentl
Copy link
Contributor

bwentl commented Feb 8, 2023

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)

@bwentl
Copy link
Contributor Author

bwentl commented Feb 13, 2023

Looks like the fix is now merged. Closing this issue. Thanks! - Bo

@bwentl bwentl closed this as completed Feb 13, 2023
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

No branches or pull requests

1 participant