-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.py
219 lines (197 loc) · 9.02 KB
/
settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
from trip_indifference.matching_functions import *
from payment.payment_functions import *
import copy
import seaborn as sns
match_functions = [get_match_for_row_lastdriverinarea, get_match_for_row_nextdrivermatched]
relevant_columns = [
"dispatched_on",
"started_on",
"completed_on",
"distance_travelled",
"end_location_lat",
"end_location_long",
"driver_rating",
"rider_rating",
"active_driver_id",
"requested_car_category",
"surge_factor",
"start_location_long",
"start_location_lat",
"rider_id",
"round_up_amount",
"driver_reached_on",
"base_fare",
"total_fare",
"rate_per_mile",
"rate_per_minute",
"time_fare",
"driver_accepted_on",
"esimtated_time_arrive",
"tipped_on",
"tip",
"driving_time_to_rider",
"driving_distance_to_rider",
"status",
"driver_id",
"car_categories_bitmask",
"rating",
"cancelled_on",
"started_on_hours_since_epoch",
"completed_on_hours_since_epoch",
"dispatched_on_hours_since_epoch",
"start_hour",
"start_hour_rounded",
"end_hour",
"end_hour_rounded",
"dispatch_hour",
"dispatch_hour_rounded",
"start_day_rounded",
"ride_total_time",
"ride_total_time_seconds",
"surged_trip",
"miles",
]
settings_datapreprocessing = {"relevant_columns": relevant_columns, "filelabel": "rides3", "folder": "data/rideaustin/"}
settings_server_2months = {
"number_of_processors": 5,
"relevant_columns": relevant_columns,
"label": "rideswithaddmin_disptime",
"preprocessed_data_filelabel": "ridesfinal",
"fileending_with_start_df": "_validreverseengineered",
"folder": "data/rideaustin/",
"driver_shift_columns": ["active_driver_id"],
"numbers_hours_next": [1, 1.5, 2], # [1, 1.5, 2],
"match_functions": [
get_match_for_row_lastdriverinarea_dispatchtime,
get_match_for_row_lastdriverinarea,
get_match_for_row_nextdrivermatched,
],
"functions_to_run": [
"pipeline_data_preprocessing",
"match_trips",
"get_match_driver_index",
"get_driver_trips_in_period_for_matches",
"get_earnings_in_period",
],
"payment_functions": payment_functions_2months_withmin,
"payment_function_names": payment_function_2months_withmin_names,
"payment_function_mult": "pure_mult_bysurgefactor_fare",
"payment_function_add": "pure_addsurge_bysurgefactor_fare",
}
settings_server_2months_fakefactor = copy.deepcopy(settings_server_2months)
settings_server_2months_fakefactor["label"] = "ridesfakefactor"
settings_server_2months_fakefactor["preprocessed_data_filelabel"] = "ridesfakefactor"
settings_server_2months_fakefactor["payment_functions"] = payment_functions_2months_withmin_fakefactor
settings_server_2months_fakefactor["payment_function_names"] = payment_function_2months_withmin_names_fakefactor
settings_server_3weeks = copy.deepcopy(settings_server_2months)
settings_server_3weeks["fileending_with_start_df"] = "_3weeks"
settings_server_3weeks["payment_functions"] = payment_functions_3weeks
settings_server_3weeks["payment_function_names"] = payment_function_3weeks_names
settings_server_3weeks["payment_function_mult"] = "pure_mult_bysurgefactor_3weeks_fare"
settings_server_3weeks["payment_function_add"] = "pure_addsurge_bysurgefactor_3weeks_fare"
settings_server_24hrs = copy.deepcopy(settings_server_2months)
settings_server_24hrs["fileending_with_start_df"] = "_24hours"
settings_server_24hrs["payment_functions"] = payment_functions_24hrs
settings_server_24hrs["payment_function_names"] = payment_function_24hrs_names
settings_server_24hrs["payment_function_mult"] = "pure_mult_bysurgefactor_24hrs_fare"
settings_server_24hrs["payment_function_add"] = "pure_addsurge_bysurgefactor_24hrs_fare"
settings_server_10hrs = copy.deepcopy(settings_server_2months)
settings_server_10hrs["fileending_with_start_df"] = "_10hours"
settings_server_10hrs["payment_functions"] = payment_functions_10hrs
settings_server_10hrs["payment_function_names"] = payment_function_10hrs_names
settings_server_10hrs["payment_function_mult"] = "pure_mult_bysurgefactor_10hrs_fare"
settings_server_10hrs["payment_function_add"] = "pure_addsurge_bysurgefactor_10hrs_fare"
plotting_differences = {
"outputrunlabel": "alldata2paymentfuns",
"numbers_hours_next": [1, 1.5, 2], # [1, 1.5, 2],#[.75, 1, 1.25, 1.5],#, 1.25, 1.5],
"match_functions": [
get_match_for_row_lastdriverinarea_dispatchtime,
get_match_for_row_nextdrivermatched,
],
"functions_to_run": [
"plot_tripindifference_histogram",
"plot_drivershift_earnings",
"supplementary_facts",
# "plot_tripindifference_variancebyaddmult",
],
"plot_colors": [
sns.light_palette("black", 2, input="xkcd").as_hex()[-1],
sns.light_palette((210, 90, 60), 2, input="husl").as_hex()[-1],
],
# "payment_functions": payment_functions_2months_withmin,
# "payment_function_names": payment_function_2months_withmin_names,
"skip_mimicfare_in_plot_stuff": False,
}
settings_plotting_puresurgeonly = copy.copy(settings_server_2months)
settings_plotting_puresurgeonly.update(plotting_differences)
settings_plotting_puresurgeonly["outputrunlabel"] = "pureonly"
settings_plotting_puresurgeonly["payment_functions"] = payment_functions_2months_pureonly
settings_plotting_puresurgeonly["payment_function_names"] = payment_function_2months_pureonly_names
settings_plotting_puresurgeonly["numbers_hours_next"] = [1.5]
settings_plotting_fakefactor = copy.copy(settings_server_2months_fakefactor)
settings_plotting_fakefactor.update(plotting_differences)
settings_plotting_fakefactor["outputrunlabel"] = "fakedata"
settings_plotting_fakefactor["payment_functions"] = payment_functions_2months_withmin_fakefactor
settings_plotting_fakefactor["payment_function_names"] = payment_function_2months_withmin_names_fakefactor
settings_plotting_fakefactor["ylim"] = (-60, 40)
settings_plotting_fakefactor["functions_to_run"] = ["plot_tripindifference_histogram"]
settings_plotting_2months_supplement = copy.copy(settings_server_2months)
settings_plotting_2months_supplement.update(plotting_differences)
settings_plotting_2months_supplement["functions_to_run"] = ["supplementary_facts"]
settings_plotting_2months = copy.copy(settings_server_2months)
settings_plotting_2months.update(plotting_differences)
settings_plotting_3weeks = copy.copy(settings_server_3weeks)
settings_plotting_3weeks.update(plotting_differences)
settings_plotting_24hrs = copy.copy(settings_server_24hrs)
settings_plotting_24hrs.update(plotting_differences)
settings_plotting_10hrs = copy.copy(settings_server_10hrs)
settings_plotting_10hrs.update(plotting_differences)
settings_all_withdispatchhour = {
"override_start_with_dispatch": True,
"number_of_processors": 55,
"relevant_columns": relevant_columns,
"preprocessed_data_filelabel": "rides_usedispatch",
"label": "rides_usedispatch",
"fileending_with_start_df": "_validreverseengineered",
"folder": "data/rideaustin/",
"numbers_hours_next": [1.5], # [1, 1.5, 2],
"match_functions": [
get_match_for_row_lastdriverinarea_dispatchtime,
get_match_for_row_nextdrivermatched,
],
"functions_to_run": [
"match_trips",
"get_match_driver_index",
"get_driver_trips_in_period_for_matches",
"get_earnings_in_period",
], #'match_trips', 'get_match_driver_index', 'get_driver_trips_in_period_for_matches',
"payment_functions": payment_functions_2months,
"payment_function_names": payment_function_2months_names,
"payment_function_mult": "pure_mult_bysurgefactor_fare",
"payment_function_add": "pure_addsurge_bysurgefactor_fare",
}
settings_all_dispatchstartmeasurement = {
"number_of_processors": 55,
"relevant_columns": relevant_columns,
"outputrunlabel": "rideswithaddmin_dispstartmeasurement",
"label": "rideswithaddmin_disptime",
"fileending_with_start_df": "_validreverseengineered",
"folder": "data/rideaustin/",
"numbers_hours_next": [1.5], # [1, 1.5, 2],
"earnings_period_start_time": "dispatch_hour",
"match_functions": [get_match_for_row_lastdriverinarea_dispatchtime],
"functions_to_run": ["get_earnings_in_period"],
"payment_functions": payment_functions_2months,
"payment_function_names": payment_function_2months_names,
"payment_function_mult": "pure_mult_bysurgefactor_fare",
"payment_function_add": "pure_addsurge_bysurgefactor_fare",
}
settings_plotting_dispatchhour = copy.copy(settings_all_withdispatchhour)
settings_plotting_dispatchhour.update(plotting_differences)
settings_plotting_dispatchhour["outputrunlabel"] = "dispatchhour"
settings_plotting_dispatchhour["ylim"] = (-60, 40)
settings_plotting_dispatchstartmeasurement = copy.copy(settings_all_dispatchstartmeasurement)
settings_plotting_dispatchstartmeasurement.update(plotting_differences)
settings_plotting_dispatchstartmeasurement["outputrunlabel"] = "dispstartmeasurement"
settings_plotting_dispatchstartmeasurement["label"] = "rideswithaddmin_disptimestartmeasurement"
settings_plotting_dispatchstartmeasurement["ylim"] = (-20, 50)