activitysim
activitysim copied to clipboard
Vague error messages when running Sharrow
I tried running our current ABM3 setup with Sharrow in production mode, but it crashed with the following error message:
Traceback (most recent call last):
File "c:\abm_runs\jflo\abm3_sharrow_0419\activitysim\activitysim\core\mp_tasks.py", line 1098, in mp_run_simulation
run_simulation(state, queue, step_info, resume_after, shared_data_buffer)
File "c:\abm_runs\jflo\abm3_sharrow_0419\activitysim\activitysim\core\mp_tasks.py", line 1048, in run_simulation
raise e
File "c:\abm_runs\jflo\abm3_sharrow_0419\activitysim\activitysim\core\mp_tasks.py", line 1043, in run_simulation
state.run.by_name(model)
File "c:\abm_runs\jflo\abm3_sharrow_0419\activitysim\activitysim\core\workflow\runner.py", line 350, in by_name
self._obj._context = run_named_step(
File "c:\abm_runs\jflo\abm3_sharrow_0419\activitysim\activitysim\core\workflow\steps.py", line 88, in run_named_step
step_func(context, **kwargs)
File "c:\abm_runs\jflo\abm3_sharrow_0419\activitysim\activitysim\core\workflow\steps.py", line 410, in run_step
outcome = error_logging(wrapped_func)(state, *args, **kwargs)
File "c:\abm_runs\jflo\abm3_sharrow_0419\activitysim\activitysim\core\workflow\steps.py", line 51, in wrapper
return func(*args, **kwargs)
File "c:\abm_runs\jflo\abm3_sharrow_0419\activitysim\activitysim\abm\models\trip_destination.py", line 1445, in trip_destination
trips_df, save_sample_df = run_trip_destination(
File "c:\abm_runs\jflo\abm3_sharrow_0419\activitysim\activitysim\core\workflow\steps.py", line 510, in wrapper
return function(state, *args, **kwargs)
File "c:\abm_runs\jflo\abm3_sharrow_0419\activitysim\activitysim\abm\models\trip_destination.py", line 1305, in run_trip_destination
choices, destination_sample = choose_trip_destination(
ValueError: Cannot convert float NaN to integer
I could tell that a null value somewhere was being converted to integer, but from my experience I'd expect for there to be more lines in between the call of run_trip_destination() and the line ValueError: Cannot convert float NaN to integer. I was eventually able to figure out that the error was caused by a couple lines in the trip mode choice preprocessor, but I feel I would have been able to figure out that more quickly with a more descriptive traceback message.
Tagging #692 for reference.
Closing as this is covered by #692