@@ -991,45 +991,58 @@ def build_virtual_path(
991991 utilities_df .index = orig .index
992992
993993 with memo ("#TVPB build_virtual_path make_choices" ):
994- probs = logit .utils_to_probs (
995- self .network_los .state ,
996- utilities_df ,
997- allow_zero_probs = True ,
998- trace_label = trace_label ,
999- overflow_protection = False ,
1000- )
1001- chunk_sizer .log_df (trace_label , "probs" , probs )
1002-
1003994 if trace :
995+ probs = logit .utils_to_probs (
996+ self .network_los .state ,
997+ utilities_df ,
998+ allow_zero_probs = True ,
999+ trace_label = trace_label ,
1000+ overflow_protection = False ,
1001+ )
1002+ chunk_sizer .log_df (trace_label , "probs" , probs )
1003+
10041004 choices = override_choices
10051005
10061006 utilities_df ["choices" ] = choices
10071007 self .trace_df (utilities_df , trace_label , "utilities_df" )
10081008
10091009 probs ["choices" ] = choices
10101010 self .trace_df (probs , trace_label , "probs" )
1011+ del probs
1012+ chunk_sizer .log_df (trace_label , "probs" , None )
10111013 else :
10121014 if self .network_los .state .settings .use_explicit_error_terms :
1015+ utilities_df = logit .validate_utils (
1016+ self .network_los .state , utilities_df , allow_zero_probs = True , trace_label = trace_label
1017+ )
10131018 choices , rands = logit .make_choices_utility_based (
10141019 self .network_los .state ,
10151020 utilities_df ,
1016- allow_bad_probs = True ,
10171021 trace_label = trace_label ,
10181022 )
10191023 else :
1024+ probs = logit .utils_to_probs (
1025+ self .network_los .state ,
1026+ utilities_df ,
1027+ allow_zero_probs = True ,
1028+ trace_label = trace_label ,
1029+ overflow_protection = False ,
1030+ )
1031+ chunk_sizer .log_df (trace_label , "probs" , probs )
1032+
10201033 choices , rands = logit .make_choices (
10211034 self .network_los .state ,
10221035 probs ,
10231036 allow_bad_probs = True ,
10241037 trace_label = trace_label ,
10251038 )
1039+ del probs
1040+ chunk_sizer .log_df (trace_label , "probs" , None )
10261041
10271042 chunk_sizer .log_df (trace_label , "rands" , rands )
10281043 del rands
10291044 chunk_sizer .log_df (trace_label , "rands" , None )
10301045
1031- del probs
1032- chunk_sizer .log_df (trace_label , "probs" , None )
10331046
10341047 # we need to get path_set, btap, atap from path_df row with same seq and path_num
10351048 # drop seq join column, but keep path_num of choice to override_choices when tracing
0 commit comments