@@ -34,6 +34,7 @@ def state() -> workflow.State:
3434 state = add_canonical_dirs ("configs_1z" ).load_settings ()
3535 network_los = los .Network_LOS (state )
3636 network_los .load_data ()
37+ state .set ("network_los" , network_los )
3738 state .set ("skim_dict" , network_los .get_default_skim_dict ())
3839 return state
3940
@@ -71,6 +72,7 @@ def tours():
7172 "origin" : [1 , 2 , 3 ],
7273 "destination" : [2 , 3 , 1 ],
7374 "period" : ["AM" , "PM" , "AM" ],
75+ "depart" : [8 , 18 , 8 ],
7476 }
7577 ).set_index ("tour_id" )
7678
@@ -88,6 +90,7 @@ def check_outputs(tours):
8890 "od_sov_time" ,
8991 "constant_test" ,
9092 "global_constant_test" ,
93+ "los_period" ,
9194 ]
9295
9396 # check all new columns are added
@@ -101,7 +104,7 @@ def check_outputs(tours):
101104 ), f"Unexpected column found: _hh_income in { tours .columns } "
102105
103106 # check the values in the new columns
104- exppected_output = pd .DataFrame (
107+ expected_output = pd .DataFrame (
105108 {
106109 "tour_id" : [1 , 2 , 3 ],
107110 "is_high_income" : [False , True , True ],
@@ -111,9 +114,11 @@ def check_outputs(tours):
111114 "od_sov_time" : [0.78 , 0.89 , 1.76 ],
112115 "constant_test" : [21 , 21 , 21 ],
113116 "global_constant_test" : [21 , 21 , 21 ],
117+ "los_period" : ["AM" , "PM" , "AM" ],
114118 }
115119 ).set_index ("tour_id" )
116- pd .testing .assert_frame_equal (tours [new_cols ], exppected_output , check_dtype = False )
120+ expected_output ["los_period" ] = expected_output ["los_period" ].astype ("category" )
121+ pd .testing .assert_frame_equal (tours [new_cols ], expected_output , check_dtype = False )
117122
118123
119124def setup_skims (state : workflow .State ):
0 commit comments