@@ -453,7 +453,7 @@ def build(self, resource: dict, write_path: Optional[str] = None) -> dict:
453
453
results_df = pd .read_csv (results_path , index_col = 0 )
454
454
results_df = results_df .groupby (results_df .index ).sum () # remove class dis-aggregation
455
455
results_df = results_df [[str (h ) for h in range (24 )]] # just keep hourly counts
456
- results_df .index .name = 'link_id '
456
+ results_df .index .name = 'stop_id '
457
457
model_results [direction ] = results_df
458
458
459
459
# build benchmark results
@@ -467,7 +467,7 @@ def build(self, resource: dict, write_path: Optional[str] = None) -> dict:
467
467
468
468
for direction , counter in counter_location .items ():
469
469
470
- stops = counter ['nodes ' ]
470
+ stops = counter ['stop_ids ' ]
471
471
bm_hours = list (counter ['counts' ])
472
472
counts_array = np .array (list (counter ['counts' ].values ()))
473
473
@@ -479,12 +479,12 @@ def build(self, resource: dict, write_path: Optional[str] = None) -> dict:
479
479
f"Hours: { bm_hours } not available in "
480
480
f"results.columns: { model_results [direction ].columns } " )
481
481
482
- # combine mode link counts
482
+ # combine mode stop counts
483
483
for stop_id in stops :
484
484
if stop_id not in model_results [direction ].index :
485
485
failed_snaps += 1
486
486
self .logger .warning (
487
- f" Missing model node : { stop_id } , zero filling count for benchmark: "
487
+ f" Missing model stop : { stop_id } , zero filling count for benchmark: "
488
488
f"{ counter_id } "
489
489
)
490
490
else :
@@ -506,7 +506,7 @@ def build(self, resource: dict, write_path: Optional[str] = None) -> dict:
506
506
else :
507
507
counter_score = 1
508
508
self .logger .warning (
509
- f"Zero size benchmark: { counter_id } link : { stop_id } , returning 1"
509
+ f"Zero size benchmark: { counter_id } stop : { stop_id } , returning 1"
510
510
)
511
511
bm_scores .append (counter_score )
512
512
@@ -516,7 +516,7 @@ def build(self, resource: dict, write_path: Optional[str] = None) -> dict:
516
516
'found' : found ,
517
517
'counter_id' : counter_id ,
518
518
'direction' : direction ,
519
- 'links ' : ',' .join (stops ),
519
+ 'stops ' : ',' .join (stops ),
520
520
'score' : counter_score ,
521
521
522
522
}
@@ -577,7 +577,7 @@ def build(self, resource: dict, write_path: Optional[str] = None) -> dict:
577
577
578
578
if failed_snaps :
579
579
report = 100 * failed_snaps / (snaps + failed_snaps )
580
- self .logger .warning (f" { report } % of links not found for bm: { self .name } " )
580
+ self .logger .warning (f" { report } % of stop_ids not found for bm: { self .name } " )
581
581
582
582
# build results df
583
583
bm_results_df = pd .DataFrame (bm_results )
@@ -603,6 +603,7 @@ def build(self, resource: dict, write_path: Optional[str] = None) -> dict:
603
603
604
604
return {'counters' : sum (bm_scores ) / len (bm_scores )}
605
605
606
+
606
607
class TestPTInteraction (TransitInteraction ):
607
608
608
609
name = 'test_pt_interaction_counter'
@@ -621,7 +622,7 @@ class LondonRODS(TransitInteraction):
621
622
622
623
name = 'london_rods'
623
624
benchmark_data_path = get_benchmark_data (
624
- os .path .join ('london' , 'london-GLA' , 'board_alight .json' )
625
+ os .path .join ('london' , 'london-GLA' , 'london-subway-board-alight-2017 .json' )
625
626
)
626
627
627
628
requirements = ['stop_interactions' ]
0 commit comments