@@ -60,7 +60,7 @@ def test_destination_presample_uses_taz_stable_mapping(monkeypatch):
6060 def fake_destination_sample (
6161 _state ,
6262 _spec_segment_name ,
63- _choosers ,
63+ choosers ,
6464 destination_size_terms ,
6565 _skims ,
6666 _estimator ,
@@ -72,6 +72,7 @@ def fake_destination_sample(
7272 stable_alt_positions = None ,
7373 n_total_alts = None ,
7474 ):
75+ captured ["origin_taz" ] = choosers [tour_destination .ORIG_TAZ ].copy ()
7576 captured ["alt_dest_col_name" ] = alt_dest_col_name
7677 captured ["zone_layer" ] = zone_layer
7778 captured ["active_taz_index" ] = destination_size_terms .index .copy ()
@@ -106,7 +107,12 @@ def fake_choose_maz_for_taz(
106107 state = workflow .State ().default_settings ()
107108 state .settings .use_explicit_error_terms = True
108109 choosers = pd .DataFrame (
109- {"origin" : [101 ]},
110+ {
111+ "origin" : [101 ],
112+ # A merged person table may carry a home TAZ that does not match
113+ # the configured tour origin.
114+ tour_destination .ORIG_TAZ : [99 ],
115+ },
110116 index = pd .Index ([7001 ], name = "tour_id" ),
111117 )
112118 model_settings = type (
@@ -152,6 +158,10 @@ def fake_choose_maz_for_taz(
152158 assert captured ["zone_layer" ] == "taz"
153159 assert captured ["n_total_alts" ] == 3
154160 assert list (captured ["stable_alt_positions" ]) == [0 , 2 ]
161+ pd .testing .assert_series_equal (
162+ captured ["origin_taz" ],
163+ pd .Series ([1 ], index = choosers .index , name = tour_destination .ORIG_TAZ ),
164+ )
155165 pd .testing .assert_index_equal (
156166 captured ["full_taz_index" ],
157167 pd .Index ([1 , 2 , 3 ], name = tour_destination .DEST_TAZ ),
0 commit comments