From 46feabec491ca7e9e02a02f7dcee5d81479cce93 Mon Sep 17 00:00:00 2001 From: Joe Flood Date: Thu, 12 Dec 2024 11:56:48 -0800 Subject: [PATCH] Skip nesting coefficient evaluation when evaluating logsums using MNL models (#909) * Update logsums.py to only evaluate nesting coefficients if the logsums are being calculated with a nested logit model * Black abm\models\util\logsums.py --- activitysim/abm/models/util/logsums.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/activitysim/abm/models/util/logsums.py b/activitysim/abm/models/util/logsums.py index a13b34344..f9e4208f0 100644 --- a/activitysim/abm/models/util/logsums.py +++ b/activitysim/abm/models/util/logsums.py @@ -167,7 +167,10 @@ def compute_location_choice_logsums( ) nest_spec = config.get_logit_model_settings(logsum_settings) - nest_spec = simulate.eval_nest_coefficients(nest_spec, coefficients, trace_label) + if nest_spec is not None: # nest_spec is None for MNL + nest_spec = simulate.eval_nest_coefficients( + nest_spec, coefficients, trace_label + ) locals_dict = {} # model_constants can appear in expressions