jwestw / Public_Transport_Efficiency

A project to measure the efficiency of public transport in the UK
MIT License
1 stars 0 forks source link

API call should take a travel time parameter and flag "unreachable" locations #4

Open chloemurrell opened 2 years ago

chloemurrell commented 2 years ago

Get API call function to take api call parameter which states the maximum travel time (similar to the locs parameter).

Currently in development we are limiting the travel time to 1 hour (set this to default value for parameter) because this reduces the amount of credits used. However, we want a selection of longer journeys as part of our stratified sampling method and within in our results so we want to remove this limit. We need the maximum time parameter within our code to vary based on the journeys we are capturing to ensure we only use the number of credits necessary.

Also, if there is a large variation between public and private transport we need to capture this time difference. We want to capture this as it is useful data for calculating our metric.

If any journey is categorised as "unreachable" this need to be flagged within our results and possibly consider resampling.

jwestw commented 2 years ago

Suggested way to flag results sets that are not the same:

 # Print a warning if the destination results are not the same
    if ([destination_result["id"] 
        for destination_result in private_refined_api_data] 
        != 
        [destination_result["id"]
         for destination_result in public_refined_api_data]:
               print("Warning: Public and Private results do not match")