Skip to content

Commit

Permalink
fix bug where large mnl simulation breaks if interaction terms aren't…
Browse files Browse the repository at this point in the history
… a list of dfs but only one df
  • Loading branch information
mxndrwgrdnr committed Jun 17, 2019
1 parent 61e6f7c commit c230075
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion urbansim_templates/models/large_multinomial_logit.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,11 @@ def run(self, chooser_batch_size=None, interaction_terms=None):
self.choices = None

if interaction_terms is not None:
uniq_intx_idx_names = set([idx for intx in interaction_terms for idx in intx.index.names])
if type(interaction_terms) == list:
uniq_intx_idx_names = set([
idx for intx in interaction_terms for idx in intx.index.names])
else:
uniq_intx_idx_names = interaction_terms.index.names
obs_extra_cols = to_list(self.chooser_size) + list(uniq_intx_idx_names)
alts_extra_cols = to_list(self.alt_capacity) + list(uniq_intx_idx_names)

Expand Down

0 comments on commit c230075

Please sign in to comment.