Skip to content

Commit 9416e29

Browse files
author
tiffanychu90
committed
feb speeds, remove reference to utils_to_add
1 parent 0efe6d3 commit 9416e29

File tree

10 files changed

+26
-48
lines changed

10 files changed

+26
-48
lines changed

rt_segment_speeds/logs/avg_speeds.log

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@
1414
2024-01-30 10:22:12.414 | INFO | __main__:multi_day_averages:338 - route seg avg 0:02:29.962531
1515
2024-01-30 10:22:54.131 | INFO | __main__:multi_day_averages:377 - route dir avg 0:00:41.717110
1616
2024-01-30 10:22:54.176 | INFO | __main__:<module>:443 - average rollups for ['2023-10-09', '2023-10-10', '2023-10-11', '2023-10-12', '2023-10-13', '2023-10-14', '2023-10-15']: 0:03:11.725898
17+
2024-02-15 14:52:09.597 | INFO | __main__:single_day_averages:194 - shape seg avg 0:00:47.942274
18+
2024-02-15 14:52:55.960 | INFO | __main__:single_day_averages:227 - route dir seg avg 0:00:46.362889
19+
2024-02-15 14:52:57.307 | INFO | __main__:single_day_averages:244 - trip avg 0:00:01.346473
20+
2024-02-15 14:53:05.722 | INFO | __main__:single_day_averages:276 - route dir avg: 0:00:08.415679
21+
2024-02-15 14:53:11.404 | INFO | __main__:<module>:433 - average rollups for 2024-01-17: 0:01:52.695658
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
2024-01-17 08:51:37.506 | INFO | __main__:<module>:71 - Analysis date: 2023-12-13
2-
2024-01-17 09:13:47.443 | INFO | __main__:<module>:118 - cut segments for all trips: 0:22:09.920160
3-
2024-01-25 17:55:11.789 | INFO | __main__:<module>:151 - cut segments 2024-01-17: 0:15:20.866136
4-
2024-01-25 18:10:52.489 | INFO | __main__:<module>:151 - cut segments 2023-12-13: 0:15:40.699105
5-
2024-01-25 18:26:27.834 | INFO | __main__:<module>:151 - cut segments 2023-11-15: 0:15:35.343763
6-
2024-01-25 18:41:57.495 | INFO | __main__:<module>:151 - cut segments 2023-10-11: 0:15:29.660398
1+
0:15:29.6603982024-02-15 13:36:56.379 | INFO | __main__:<module>:156 - cut segments 2024-02-14: 0:13:55.835925
Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1 @@
1-
2023-12-14 11:37:11.735 | INFO | __main__:<module>:215 - Analysis date: 2023-12-13
2-
2023-12-14 11:39:47.181 | INFO | __main__:main:184 - stop_segments: set up df with nearest / subseq vp info: 0:02:35.392831
3-
2023-12-14 11:40:48.345 | INFO | __main__:main:190 - interpolate stop arrival: 0:01:01.164427
4-
2023-12-14 11:40:59.919 | INFO | __main__:main:196 - execution time for stop_segments: 0:03:48.131217
5-
2024-01-24 09:54:22.652 | INFO | __main__:interpolate_stop_arrivals:107 - get stop arrivals 2024-01-17: 0:10:11.131591
6-
2024-01-27 19:51:50.425 | INFO | __main__:interpolate_stop_arrivals:110 - get stop arrivals 2023-12-13: 0:09:47.554048
7-
2024-01-27 20:02:03.868 | INFO | __main__:interpolate_stop_arrivals:110 - get stop arrivals 2023-11-15: 0:10:13.251370
8-
2024-01-27 20:11:39.908 | INFO | __main__:interpolate_stop_arrivals:110 - get stop arrivals 2023-10-11: 0:09:35.901028
1+
2024-02-15 14:18:47.082 | INFO | __main__:interpolate_stop_arrivals:110 - get stop arrivals 2024-02-14: 0:09:37.655118

rt_segment_speeds/logs/nearest_vp.log

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,2 @@
1-
2023-12-14 11:24:08.032 | INFO | __main__:<module>:342 - Analysis date: 2023-12-13
2-
2023-12-14 11:30:59.475 | INFO | __main__:find_nearest_vp_to_stop:280 - map partitions to transform vp: 0:06:51.416122
3-
2023-12-14 11:31:01.378 | INFO | __main__:find_nearest_vp_to_stop:312 - map partitions to find nearest vp to stop: 0:00:01.903498
4-
2024-01-27 13:45:18.221 | INFO | __main__:nearest_neighbor_shape_segments:203 - shape segments 2023-12-13: 0:11:38.045844
5-
2024-01-27 14:19:15.940 | INFO | __main__:nearest_neighbor_shape_segments:206 - shape segments 2023-12-13: 0:11:37.741682
6-
2024-01-27 17:07:34.843 | INFO | __main__:nearest_neighbor_shape_segments:204 - shape segments 2023-11-15: 0:12:02.309702
7-
2024-01-27 17:19:42.602 | INFO | __main__:nearest_neighbor_rt_stop_times:136 - RT stop times 2023-11-15: 0:12:04.187679
8-
2024-01-27 17:46:11.054 | INFO | __main__:nearest_neighbor_shape_segments:204 - shape segments 2023-10-11: 0:11:47.793159
9-
2024-01-27 17:58:02.005 | INFO | __main__:nearest_neighbor_rt_stop_times:136 - RT stop times 2023-10-11: 0:11:47.705595
1+
2024-02-15 13:48:26.270 | INFO | __main__:nearest_neighbor_shape_segments:203 - shape segments 2024-02-14: 0:10:31.474349
2+
2024-02-15 14:08:52.783 | INFO | __main__:nearest_neighbor_rt_stop_times:135 - RT stop times 2024-02-14: 0:11:07.883083
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
1-
2024-01-24 17:15:10.165 | INFO | __main__:calculate_speed_from_stop_arrivals:132 - speeds by segment: 2024-01-17: 0:00:25.610204
2-
2024-01-27 20:12:24.879 | INFO | __main__:calculate_speed_from_stop_arrivals:132 - speeds by segment: 2023-12-13: 0:00:26.567386
3-
2024-01-27 20:12:50.577 | INFO | __main__:calculate_speed_from_stop_arrivals:132 - speeds by segment: 2023-11-15: 0:00:25.530726
4-
2024-01-27 20:13:15.096 | INFO | __main__:calculate_speed_from_stop_arrivals:132 - speeds by segment: 2023-10-11: 0:00:24.355903
5-
2024-01-28 15:12:19.958 | INFO | __main__:calculate_speed_from_stop_arrivals:132 - speeds by segment: 2023-09-13: 0:00:21.749183
6-
2024-01-28 15:12:40.323 | INFO | __main__:calculate_speed_from_stop_arrivals:132 -
1+
2024-02-15 14:19:36.965 | INFO | __main__:calculate_speed_from_stop_arrivals:132 - speeds by segment: 2024-02-14: 0:00:31.989535
2+
2024-02-15 14:45:36.035 | INFO | __main__:calculate_speed_from_stop_arrivals:132 - speeds by segment: 2024-01-17: 0:00:32.109610

rt_segment_speeds/scripts/average_speeds.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from typing import Literal
1313

1414
from calitp_data_analysis.geography_utils import WGS84
15-
from shared_utils import utils_to_add
1615
from calitp_data_analysis import utils
1716
from segment_speed_utils import (gtfs_schedule_wrangling, helpers,
1817
segment_calcs, time_helpers)
@@ -183,7 +182,7 @@ def single_day_averages(analysis_date: str, dict_inputs: dict):
183182
columns = col_order + ["geometry"]
184183
)
185184

186-
utils_to_add.geoparquet_gcs_export(
185+
utils.geoparquet_gcs_export(
187186
shape_stop_segments,
188187
SEGMENT_GCS,
189188
f"{SHAPE_SEG_FILE}_{analysis_date}"
@@ -216,7 +215,7 @@ def single_day_averages(analysis_date: str, dict_inputs: dict):
216215
columns = col_order + ["geometry"]
217216
)
218217

219-
utils_to_add.geoparquet_gcs_export(
218+
utils.geoparquet_gcs_export(
220219
route_dir_segments,
221220
SEGMENT_GCS,
222221
f"{ROUTE_SEG_FILE}_{analysis_date}"
@@ -265,7 +264,7 @@ def single_day_averages(analysis_date: str, dict_inputs: dict):
265264
columns = col_order + ["route_name", "geometry"]
266265
)
267266

268-
utils_to_add.geoparquet_gcs_export(
267+
utils.geoparquet_gcs_export(
269268
route_dir_avg,
270269
SEGMENT_GCS,
271270
f"{ROUTE_DIR_FILE}_{analysis_date}"
@@ -328,7 +327,7 @@ def multi_day_averages(analysis_date_list: list, dict_inputs: dict):
328327
columns = col_order + ["geometry"]
329328
)
330329

331-
utils_to_add.geoparquet_gcs_export(
330+
utils.geoparquet_gcs_export(
332331
route_dir_segments,
333332
SEGMENT_GCS,
334333
f"{ROUTE_SEG_FILE}_{time_span_str}"
@@ -433,7 +432,7 @@ def stage_open_data_exports(analysis_date: str, dict_inputs: dict):
433432

434433
logger.info(f"average rollups for {analysis_date}: {end - start}")
435434

436-
435+
'''
437436
for month in ["apr2023", "oct2023"]:
438437
start = datetime.datetime.now()
439438
@@ -443,5 +442,5 @@ def stage_open_data_exports(analysis_date: str, dict_inputs: dict):
443442
end = datetime.datetime.now()
444443
445444
logger.info(f"average rollups for {one_week}: {end - start}")
446-
445+
'''
447446

rt_segment_speeds/scripts/cut_stop_segments.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414

1515
from loguru import logger
1616

17-
#from calitp_data_analysis import utils
18-
from shared_utils import utils_to_add
17+
from calitp_data_analysis import utils
1918
from calitp_data_analysis.geography_utils import WGS84
2019
from segment_speed_utils import gtfs_schedule_wrangling, helpers
2120
from segment_speed_utils.project_vars import (SEGMENT_GCS,
@@ -145,7 +144,7 @@ def cut_stop_segments(analysis_date: str) -> gpd.GeoDataFrame:
145144
how = "inner"
146145
)
147146

148-
utils_to_add.geoparquet_gcs_export(
147+
utils.geoparquet_gcs_export(
149148
segments,
150149
SEGMENT_GCS,
151150
f"{SEGMENT_FILE}_{analysis_date}"

rt_segment_speeds/scripts/nearest_vp_to_stop.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
from loguru import logger
1313

1414
from calitp_data_analysis.geography_utils import WGS84
15-
#from calitp_data_analysis import utils
16-
from shared_utils import utils_to_add
15+
from calitp_data_analysis import utils
1716
from segment_speed_utils import helpers, neighbor
1817
from segment_speed_utils.project_vars import SEGMENT_GCS
1918

@@ -108,7 +107,7 @@ def nearest_neighbor_rt_stop_times(
108107
includes all trips. Use stop sequences for each trip.
109108
"""
110109
start = datetime.datetime.now()
111-
EXPORT_FILE = Path(f'{dict_inputs["stage2"]}')
110+
EXPORT_FILE = f'{dict_inputs["stage2"]}'
112111

113112
stop_times = helpers.import_scheduled_stop_times(
114113
analysis_date,
@@ -126,7 +125,7 @@ def nearest_neighbor_rt_stop_times(
126125

127126
results = add_nearest_neighbor_result(gdf, analysis_date)
128127

129-
utils_to_add.geoparquet_gcs_export(
128+
utils.geoparquet_gcs_export(
130129
results,
131130
SEGMENT_GCS,
132131
f"{EXPORT_FILE}_{analysis_date}",
@@ -194,7 +193,7 @@ def nearest_neighbor_shape_segments(
194193

195194
del gdf
196195

197-
utils_to_add.geoparquet_gcs_export(
196+
utils.geoparquet_gcs_export(
198197
results,
199198
SEGMENT_GCS,
200199
f"{EXPORT_FILE}_{analysis_date}",

rt_segment_speeds/scripts/select_stop_segments.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
import geopandas as gpd
1414
import pandas as pd
1515

16-
#from calitp_data_analysis import utils
17-
from shared_utils import utils_to_add
16+
from calitp_data_analysis import utils
1817
from shared_utils import rt_dates
1918
from segment_speed_utils import helpers
2019
from segment_speed_utils.project_vars import SEGMENT_GCS
@@ -73,7 +72,7 @@ def select_one_trip_per_shape(analysis_date: str):
7372

7473
segments = select_one_trip_per_shape(analysis_date)
7574

76-
utils_to_add.geoparquet_gcs_export(
75+
utils.geoparquet_gcs_export(
7776
segments,
7877
SEGMENT_GCS,
7978
f"{SEGMENT_FILE}_{analysis_date}"

rt_segment_speeds/segment_speed_utils/array_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def monotonic_check(arr: np.ndarray) -> bool:
3131
"""
3232
diff_arr = np.diff(arr)
3333

34-
if np.all(diff_arr >= 0):
34+
if np.all(diff_arr > 0):
3535
return True
3636
else:
3737
return False

0 commit comments

Comments
 (0)