Skip to content

Commit 6a0987d

Browse files
author
Jan Zill
committed
identifies eet todos
1 parent c6d60c6 commit 6a0987d

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

activitysim/abm/models/joint_tour_participation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def participants_chooser(
207207
)
208208
print(unsatisfied_candidates.head(20))
209209

210-
# TODO: explicit error term impl of force participation
210+
# TODO-EET: explicit error term impl of force participation
211211
if model_settings.FORCE_PARTICIPATION and not state.settings.use_explicit_error_terms:
212212
logger.warning(
213213
f"Forcing joint tour participation for {num_tours_remaining} tours."

activitysim/abm/models/util/cdap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@ def household_activity_choices(
10331033
"%s.hhsize%d_activity_choices" % (trace_label, hhsize),
10341034
column_labels=["expression", "household"],
10351035
)
1036-
# TODO: check if different num rands matters here
1036+
# TODO-EET: check if different num rands matters here
10371037
state.tracing.trace_df(
10381038
rands, "%s.hhsize%d_rands" % (trace_label, hhsize), columns=[None, "rand"]
10391039
)

activitysim/core/logit.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def utils_to_probs(
270270
return probs
271271

272272

273-
# todo: check state, add type annotations, check new-world tracing, etc.
273+
# TODO-EET: check state, add type annotations, check new-world tracing, etc.
274274
def add_ev1_random(state: workflow.State, df: pd.DataFrame):
275275
nest_utils_for_choice = df.copy()
276276
nest_utils_for_choice += state.get_rn_generator().gumbel_for_df(nest_utils_for_choice, n=df.shape[1])
@@ -289,7 +289,7 @@ def choose_from_tree(nest_utils, all_alternatives, logit_nest_groups, nest_alter
289289
raise ValueError("This should never happen - no alternative found")
290290

291291

292-
# TODO [janzill Jun2022]: make everything in nested and here numpy from beginning to make choices consistent with
292+
# TODO-EET [janzill Jun2022]: make everything in nested and here numpy from beginning to make choices consistent with
293293
# previous impl (want column index and not alternative name)
294294
# Note: this is relatively slow due to the apply.
295295
# It could *maybe* be sped up by using the fact that the nesting structure is the same for all rows: Add ev1(0,1) to
@@ -322,7 +322,7 @@ def make_choices_explicit_error_term_nl(state, nested_utilities, alt_order_array
322322
def make_choices_explicit_error_term_mnl(state, utilities):
323323
utilities_incl_unobs = add_ev1_random(state, utilities)
324324
choices = np.argmax(utilities_incl_unobs.to_numpy(), axis=1)
325-
# TODO: reporting like for zero probs
325+
# TODO-EET: reporting like for zero probs
326326
assert not np.isnan(choices).any(), "No choice for XXX - implement reporting"
327327
choices = pd.Series(choices, index=utilities_incl_unobs.index)
328328
return choices
@@ -337,7 +337,7 @@ def make_choices_explicit_error_term(state, utilities, alt_order_array, nest_spe
337337
return choices
338338

339339

340-
# TODO: memory usage
340+
# TODO-EET: memory usage
341341
def make_choices_utility_based(
342342
state: workflow.State,
343343
utilities: pd.DataFrame,
@@ -351,10 +351,10 @@ def make_choices_utility_based(
351351
) -> tuple[pd.Series, pd.Series]:
352352
trace_label = tracing.extend_trace_label(trace_label, 'make_choices_utility_based')
353353

354-
# TODO: index of choices for nested utilities is different than unnested - this needs to be consistent for
354+
# TODO-EET: index of choices for nested utilities is different than unnested - this needs to be consistent for
355355
# turning indexes into alternative names to keep code changes to minimum for now
356356
choices = make_choices_explicit_error_term(state, utilities, name_mapping, nest_spec, trace_label)
357-
# TODO: rands - log all zeros for now
357+
# TODO-EET: rands - log all zeros for now
358358
rands = pd.Series(np.zeros_like(utilities.index.values), index=utilities.index)
359359
return choices, rands
360360

@@ -663,7 +663,7 @@ def each_nest(nest_spec: dict | LogitNestSpec, type=None, post_order=False):
663663
yield nest
664664

665665

666-
# TODO: do I need to implement this for LogitNestSpec?
666+
# TODO-EET: do I need to implement this for LogitNestSpec?
667667
def count_nests(nest_spec):
668668
"""
669669
count the nests in nest_spec, return 0 if nest_spec is none

activitysim/core/simulate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,12 +1436,12 @@ def eval_nl(
14361436
)
14371437

14381438
if state.settings.use_explicit_error_terms:
1439-
# TODO [janzill Jun2022]: combine with nested_exp_utilities?
1439+
# TODO-EET [janzill Jun2022]: combine with nested_exp_utilities?
14401440
# utilities of leaves and nests
14411441
nested_utilities = compute_nested_utilities(raw_utilities, nest_spec)
14421442
chunk_sizer.log_df(trace_label, "nested_utilities", nested_utilities)
14431443

1444-
# TODO [janzill Jun2022]: this can be done from utils directly, but use existing methodology for prototype
1444+
# TODO-EET [janzill Jun2022]: this can be done from utils directly, but use existing methodology for prototype
14451445
if want_logsums:
14461446
# logsum of nest root
14471447
# exponentiated utilities of leaves and nests
@@ -1450,7 +1450,7 @@ def eval_nl(
14501450
logsums = pd.Series(np.log(nested_exp_utilities.root), index=choosers.index)
14511451
chunk_sizer.log_df(trace_label, "logsums", logsums)
14521452

1453-
# TODO: index of choices for nested utilities is different than unnested - this needs to be consistent for
1453+
# TODO-EET: index of choices for nested utilities is different than unnested - this needs to be consistent for
14541454
# turning indexes into alternative names to keep code changes to minimum for now
14551455
name_mapping = raw_utilities.columns.values
14561456

0 commit comments

Comments
 (0)