From 459b3d9454861e3db5a71862b3d4b92b6d904b64 Mon Sep 17 00:00:00 2001 From: Britt Allen Date: Wed, 17 Jul 2024 23:15:16 +0000 Subject: [PATCH 01/22] added the length column to the station_agg_five_minutes model, renamed the bottlenecks model, first pass at code for the extent model --- ...learinghouse__station_agg_five_minutes.sql | 1 + ... int_performance__bottleneck_duration.sql} | 5 ++-- .../int_performance__bottleneck_extent.sql | 28 +++++++++++++++++++ 3 files changed, 31 insertions(+), 3 deletions(-) rename transform/models/intermediate/performance/{int_performance__bottlenecks.sql => int_performance__bottleneck_duration.sql} (93%) create mode 100644 transform/models/intermediate/performance/int_performance__bottleneck_extent.sql diff --git a/transform/models/intermediate/clearinghouse/int_clearinghouse__station_agg_five_minutes.sql b/transform/models/intermediate/clearinghouse/int_clearinghouse__station_agg_five_minutes.sql index 15f809cc..df3e0e4b 100644 --- a/transform/models/intermediate/clearinghouse/int_clearinghouse__station_agg_five_minutes.sql +++ b/transform/models/intermediate/clearinghouse/int_clearinghouse__station_agg_five_minutes.sql @@ -43,6 +43,7 @@ station_aggregated_speed as ( any_value(district) as district, any_value(latitude) as latitude, any_value(longitude) as longitude, + any_value(length) as length, sum(sample_ct) as sample_ct, sum(volume_sum) as volume_sum, avg(occupancy_avg) as occupancy_avg, diff --git a/transform/models/intermediate/performance/int_performance__bottlenecks.sql b/transform/models/intermediate/performance/int_performance__bottleneck_duration.sql similarity index 93% rename from transform/models/intermediate/performance/int_performance__bottlenecks.sql rename to transform/models/intermediate/performance/int_performance__bottleneck_duration.sql index 47f98763..7377d938 100644 --- a/transform/models/intermediate/performance/int_performance__bottlenecks.sql +++ b/transform/models/intermediate/performance/int_performance__bottleneck_duration.sql @@ -17,8 +17,7 @@ station_five_minute as ( direction, station_type, absolute_postmile, - latitude, - longitude + length from {{ ref ("int_clearinghouse__station_agg_five_minutes") }} where {{ make_model_incremental('sample_date') }} @@ -87,7 +86,7 @@ temporal_extent_check as ( temporal_extent as ( select - * exclude (latitude, longitude, bottleneck_check, bottleneck_check_summed), + * exclude (bottleneck_check, bottleneck_check_summed), iff(bottleneck_check_summed >= 5, true, false) as is_bottleneck from temporal_extent_check ) diff --git a/transform/models/intermediate/performance/int_performance__bottleneck_extent.sql b/transform/models/intermediate/performance/int_performance__bottleneck_extent.sql new file mode 100644 index 00000000..8eafba3c --- /dev/null +++ b/transform/models/intermediate/performance/int_performance__bottleneck_extent.sql @@ -0,0 +1,28 @@ +{{ config( + materialized="incremental", + cluster_by=["sample_date"], + unique_key=["station_id", "sample_date", "sample_timestamp"], + snowflake_warehouse = get_snowflake_refresh_warehouse(small="XS") +) }} + +with + +bottleneck_duration as ( + select * from {{ ref ("int_performance__bottleneck_duration") }} + where {{ make_model_incremental('sample_date') }} +), + +extent_cte as ( + select + station_id, + sample_date, + sample_timestamp, + is_bottleneck, + case + when is_bottleneck = true + then sum(length) over (partition by sample_timestamp, station_id) + end as extent + from bottleneck_duration +) + +select * from extent_cte From 94b83851d9ea04888b46cf3890938802b716211d Mon Sep 17 00:00:00 2001 From: Britt Allen Date: Thu, 18 Jul 2024 21:13:15 +0000 Subject: [PATCH 02/22] changed filename again to be more accurate, added additional columns for testing --- .../performance/int_performance__bottleneck_extent.sql | 7 +++++-- ..._duration.sql => int_performance__bottleneck_start.sql} | 0 2 files changed, 5 insertions(+), 2 deletions(-) rename transform/models/intermediate/performance/{int_performance__bottleneck_duration.sql => int_performance__bottleneck_start.sql} (100%) diff --git a/transform/models/intermediate/performance/int_performance__bottleneck_extent.sql b/transform/models/intermediate/performance/int_performance__bottleneck_extent.sql index 8eafba3c..9ebabdaa 100644 --- a/transform/models/intermediate/performance/int_performance__bottleneck_extent.sql +++ b/transform/models/intermediate/performance/int_performance__bottleneck_extent.sql @@ -8,15 +8,18 @@ with bottleneck_duration as ( - select * from {{ ref ("int_performance__bottleneck_duration") }} + select * from {{ ref ("int_performance__bottleneck_start") }} where {{ make_model_incremental('sample_date') }} ), extent_cte as ( select - station_id, sample_date, sample_timestamp, + station_id, + freeway, + direction, + station_type, is_bottleneck, case when is_bottleneck = true diff --git a/transform/models/intermediate/performance/int_performance__bottleneck_duration.sql b/transform/models/intermediate/performance/int_performance__bottleneck_start.sql similarity index 100% rename from transform/models/intermediate/performance/int_performance__bottleneck_duration.sql rename to transform/models/intermediate/performance/int_performance__bottleneck_start.sql From 7d7a5cea33d3ecf41712bd544202b9ff6cee86c2 Mon Sep 17 00:00:00 2001 From: Britt Allen Date: Mon, 22 Jul 2024 21:04:39 +0000 Subject: [PATCH 03/22] missed a file as part of merge conflict resolution --- ...ance__station_metrics_agg_five_minutes.sql | 66 +++++++++---------- 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql b/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql index b1fe7a26..47f8b85f 100644 --- a/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql +++ b/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql @@ -1,4 +1,3 @@ -<<<<<<< HEAD:transform/models/intermediate/clearinghouse/int_clearinghouse__station_agg_five_minutes.sql {{ config( materialized="incremental", cluster_by=["sample_date"], @@ -55,36 +54,35 @@ station_aggregated_speed as ( select * from station_aggregated_speed ======= -{{ config( - materialized="incremental", - cluster_by=["sample_date"], - unique_key=["station_id", "sample_date", "sample_timestamp"], - snowflake_warehouse = get_snowflake_refresh_warehouse(big="XL") -) }} - -with detector_agg_five_minutes as ( - select * - from {{ ref('int_imputation__detector_imputed_agg_five_minutes') }} - where {{ make_model_incremental('sample_date') }} -), - -station_aggregated_speed as ( - select - station_id, - sample_date, - sample_timestamp, - any_value(freeway) as freeway, - any_value(direction) as direction, - any_value(station_type) as station_type, - any_value(absolute_postmile) as absolute_postmile, - any_value(district) as district, - sum(sample_ct) as sample_ct, - sum(volume_sum) as volume_sum, - avg(occupancy_avg) as occupancy_avg, - sum(volume_sum * speed_weighted) / nullifzero(sum(volume_sum)) as speed_weighted - from detector_agg_five_minutes - group by station_id, sample_date, sample_timestamp -) - -select * from station_aggregated_speed ->>>>>>> 78af5cbeffa5158a1302ccd41a7d052faf0fc968:transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql +{{ config( + materialized="incremental", + cluster_by=["sample_date"], + unique_key=["station_id", "sample_date", "sample_timestamp"], + snowflake_warehouse = get_snowflake_refresh_warehouse(big="XL") +) }} + +with detector_agg_five_minutes as ( + select * + from {{ ref('int_imputation__detector_imputed_agg_five_minutes') }} + where {{ make_model_incremental('sample_date') }} +), + +station_aggregated_speed as ( + select + station_id, + sample_date, + sample_timestamp, + any_value(freeway) as freeway, + any_value(direction) as direction, + any_value(station_type) as station_type, + any_value(absolute_postmile) as absolute_postmile, + any_value(district) as district, + sum(sample_ct) as sample_ct, + sum(volume_sum) as volume_sum, + avg(occupancy_avg) as occupancy_avg, + sum(volume_sum * speed_weighted) / nullifzero(sum(volume_sum)) as speed_weighted + from detector_agg_five_minutes + group by station_id, sample_date, sample_timestamp +) + +select * from station_aggregated_speed From 0d8a89ec9a0496681c2da8df5d7585cf1909c6f9 Mon Sep 17 00:00:00 2001 From: Britt Allen Date: Mon, 22 Jul 2024 22:12:22 +0000 Subject: [PATCH 04/22] fixing two more merge conflict mistakes --- .../intermediate/performance/_performance.yml | 2 +- ...ance__station_metrics_agg_five_minutes.sql | 56 ------------------- 2 files changed, 1 insertion(+), 57 deletions(-) diff --git a/transform/models/intermediate/performance/_performance.yml b/transform/models/intermediate/performance/_performance.yml index 78577721..e093479a 100644 --- a/transform/models/intermediate/performance/_performance.yml +++ b/transform/models/intermediate/performance/_performance.yml @@ -424,7 +424,7 @@ models: description: 50th highest hour volume in the precceding year. - name: K_100 description: 100th highest hour volume in the precceding year. - - name: int_performance__bottlenecks + - name: int_performance__bottleneck_start description: | The PeMS system runs a bottleneck identification algorithm every day. The original algorithm was presented in, "Systematic Identification of Freeway Bottlenecks," by Chen, C., Skabardonis, A., diff --git a/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql b/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql index 47f8b85f..64d82780 100644 --- a/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql +++ b/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql @@ -1,59 +1,3 @@ -{{ config( - materialized="incremental", - cluster_by=["sample_date"], - unique_key=["station_id", "sample_timestamp"], - snowflake_warehouse = get_snowflake_refresh_warehouse(big="XL") -) }} - -with detector_agg_five_minutes as ( - select * - from {{ ref('int_clearinghouse__detector_agg_five_minutes') }} - where {{ make_model_incremental('sample_date') }} -), - -real_detector_status as ( - select - station_id as id, - status, - sample_date, - lane - from {{ ref ("int_diagnostics__real_detector_status") }} - where status = 'Good' -), - -joined_data as ( - select d.* - from detector_agg_five_minutes as d - inner join real_detector_status as r - on - d.lane = r.lane - and d.station_id = r.id - and d.sample_date = r.sample_date -), - -station_aggregated_speed as ( - select - station_id, - sample_date, - sample_timestamp, - any_value(freeway) as freeway, - any_value(direction) as direction, - any_value(station_type) as station_type, - any_value(absolute_postmile) as absolute_postmile, - any_value(district) as district, - any_value(latitude) as latitude, - any_value(longitude) as longitude, - any_value(length) as length, - sum(sample_ct) as sample_ct, - sum(volume_sum) as volume_sum, - avg(occupancy_avg) as occupancy_avg, - sum(volume_sum * speed_weighted) / nullifzero(sum(volume_sum)) as speed_weighted - from joined_data - group by station_id, sample_date, sample_timestamp -) - -select * from station_aggregated_speed -======= {{ config( materialized="incremental", cluster_by=["sample_date"], From cfd22a26482592c08af86de816b3220e64fde4bb Mon Sep 17 00:00:00 2001 From: Britt Allen Date: Mon, 22 Jul 2024 22:19:16 +0000 Subject: [PATCH 05/22] linting fixes --- .../performance/int_performance__bottleneck_start.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/transform/models/intermediate/performance/int_performance__bottleneck_start.sql b/transform/models/intermediate/performance/int_performance__bottleneck_start.sql index 8990c6a9..9613b0ef 100644 --- a/transform/models/intermediate/performance/int_performance__bottleneck_start.sql +++ b/transform/models/intermediate/performance/int_performance__bottleneck_start.sql @@ -18,7 +18,6 @@ station_five_minute as ( station_type, absolute_postmile, length - absolute_postmile from {{ ref ("int_performance__station_metrics_agg_five_minutes") }} where {{ make_model_incremental('sample_date') }} From ff455fd4fd47830b7008e9eaca919f13bae4bf6e Mon Sep 17 00:00:00 2001 From: Britt Allen Date: Mon, 22 Jul 2024 23:03:44 +0000 Subject: [PATCH 06/22] added length column in downstream model --- .../int_performance__station_metrics_agg_five_minutes.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql b/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql index 64d82780..3963dfa2 100644 --- a/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql +++ b/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql @@ -21,6 +21,7 @@ station_aggregated_speed as ( any_value(station_type) as station_type, any_value(absolute_postmile) as absolute_postmile, any_value(district) as district, + any_value(leangth) as length, sum(sample_ct) as sample_ct, sum(volume_sum) as volume_sum, avg(occupancy_avg) as occupancy_avg, From 6a4fdbf0bb51e790091cf8a4545675a0dd1894e0 Mon Sep 17 00:00:00 2001 From: Britt Allen Date: Tue, 23 Jul 2024 00:21:34 +0000 Subject: [PATCH 07/22] fixed a typo --- .../int_performance__station_metrics_agg_five_minutes.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql b/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql index 3963dfa2..973fbd87 100644 --- a/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql +++ b/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql @@ -21,7 +21,7 @@ station_aggregated_speed as ( any_value(station_type) as station_type, any_value(absolute_postmile) as absolute_postmile, any_value(district) as district, - any_value(leangth) as length, + any_value(length) as length, sum(sample_ct) as sample_ct, sum(volume_sum) as volume_sum, avg(occupancy_avg) as occupancy_avg, From 5c4b79d60cd9baeeee39f154cb0fc8f56bf65005 Mon Sep 17 00:00:00 2001 From: Britt Allen Date: Tue, 23 Jul 2024 22:59:55 +0000 Subject: [PATCH 08/22] added postmile column --- .../performance/int_performance__bottleneck_extent.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/transform/models/intermediate/performance/int_performance__bottleneck_extent.sql b/transform/models/intermediate/performance/int_performance__bottleneck_extent.sql index 9ebabdaa..81aed3d1 100644 --- a/transform/models/intermediate/performance/int_performance__bottleneck_extent.sql +++ b/transform/models/intermediate/performance/int_performance__bottleneck_extent.sql @@ -17,6 +17,7 @@ extent_cte as ( sample_date, sample_timestamp, station_id, + absolute_postmile, freeway, direction, station_type, From 9c51e802e69e5e5d98db95630d2b1bd563d06742 Mon Sep 17 00:00:00 2001 From: Britt Allen Date: Tue, 23 Jul 2024 23:10:03 +0000 Subject: [PATCH 09/22] renamed speed_weighted to speed_five_mins in the station_five_min model --- .../int_performance__station_metrics_agg_five_minutes.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql b/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql index 973fbd87..92017855 100644 --- a/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql +++ b/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql @@ -25,7 +25,7 @@ station_aggregated_speed as ( sum(sample_ct) as sample_ct, sum(volume_sum) as volume_sum, avg(occupancy_avg) as occupancy_avg, - sum(volume_sum * speed_weighted) / nullifzero(sum(volume_sum)) as speed_weighted + sum(volume_sum * speed_five_mins) / nullifzero(sum(volume_sum)) as speed_five_mins from detector_agg_five_minutes group by station_id, sample_date, sample_timestamp ) From 84bcc8a0f3f0ea2262acf091b911a7b5aee15ab7 Mon Sep 17 00:00:00 2001 From: Britt Allen Date: Tue, 23 Jul 2024 23:16:32 +0000 Subject: [PATCH 10/22] updated speed_weighted to speed_five_mins in bottleneck-releated models --- .../performance/int_performance__bottleneck_extent.sql | 1 + .../performance/int_performance__bottleneck_start.sql | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/transform/models/intermediate/performance/int_performance__bottleneck_extent.sql b/transform/models/intermediate/performance/int_performance__bottleneck_extent.sql index 81aed3d1..58dd30b3 100644 --- a/transform/models/intermediate/performance/int_performance__bottleneck_extent.sql +++ b/transform/models/intermediate/performance/int_performance__bottleneck_extent.sql @@ -21,6 +21,7 @@ extent_cte as ( freeway, direction, station_type, + speed_five_mins, is_bottleneck, case when is_bottleneck = true diff --git a/transform/models/intermediate/performance/int_performance__bottleneck_start.sql b/transform/models/intermediate/performance/int_performance__bottleneck_start.sql index 9613b0ef..800ec5b6 100644 --- a/transform/models/intermediate/performance/int_performance__bottleneck_start.sql +++ b/transform/models/intermediate/performance/int_performance__bottleneck_start.sql @@ -12,7 +12,7 @@ station_five_minute as ( station_id, sample_date, sample_timestamp, - speed_weighted, + speed_five_mins, freeway, direction, station_type, @@ -33,11 +33,11 @@ calcs as ( to get the speed there. When the direction is west or south, the "upstream" station has a larger postmile, and we need to lead to get the speed there. */ - speed_weighted - lag(speed_weighted) + speed_five_mins - lag(speed_five_mins) over (partition by sample_timestamp, freeway, direction, station_type order by absolute_postmile asc) as speed_delta_ne, - speed_weighted - lead(speed_weighted) + speed_five_mins - lead(speed_five_mins) over (partition by sample_timestamp, freeway, direction, station_type order by absolute_postmile asc) as speed_delta_sw, @@ -57,13 +57,13 @@ bottleneck_criteria as ( *, case when - speed_weighted < 40 + speed_five_mins < 40 and abs(distance_delta_ne) < 3 and speed_delta_ne <= -20 and (direction = 'N' or direction = 'E') then 1 when - speed_weighted < 40 + speed_five_mins < 40 and abs(distance_delta_sw) < 3 and speed_delta_sw <= -20 and (direction = 'S' or direction = 'W') From 864554f4c893cf80fa1f78298b3d6102ed22fd93 Mon Sep 17 00:00:00 2001 From: Ian Rose Date: Tue, 30 Jul 2024 20:41:25 +0000 Subject: [PATCH 11/22] experiments with an islands and gaps approach to looking at bottleneck extent --- .../int_performance__bottleneck_extent.sql | 74 ++++++++++++++----- .../int_performance__bottleneck_start.sql | 2 +- 2 files changed, 58 insertions(+), 18 deletions(-) diff --git a/transform/models/intermediate/performance/int_performance__bottleneck_extent.sql b/transform/models/intermediate/performance/int_performance__bottleneck_extent.sql index 58dd30b3..48360e5c 100644 --- a/transform/models/intermediate/performance/int_performance__bottleneck_extent.sql +++ b/transform/models/intermediate/performance/int_performance__bottleneck_extent.sql @@ -2,32 +2,72 @@ materialized="incremental", cluster_by=["sample_date"], unique_key=["station_id", "sample_date", "sample_timestamp"], - snowflake_warehouse = get_snowflake_refresh_warehouse(small="XS") + snowflake_warehouse = get_snowflake_refresh_warehouse(small="XS", big="XL") ) }} with -bottleneck_duration as ( +bottleneck_start as ( select * from {{ ref ("int_performance__bottleneck_start") }} where {{ make_model_incremental('sample_date') }} ), -extent_cte as ( +congestion as ( select - sample_date, - sample_timestamp, - station_id, - absolute_postmile, - freeway, - direction, - station_type, - speed_five_mins, - is_bottleneck, + *, + speed_five_mins < 40 as is_congested, + + /* Create a helper length field which is zero if we don't consider this station + congested and the station length if we do. This will be summed later to get + the congestion extent */ + iff(is_congested, length, 0) as congestion_length, + + /* Absolute postmile increases going north and east. When the direction of the freeway for a + station is north or east, the "upstream" station has a smaller postmile, and we need to lag + to get the speed there. When the direction is west or south, the "upstream" station has a + larger postmile, and we need to lead to get the speed there. */ case - when is_bottleneck = true - then sum(length) over (partition by sample_timestamp, station_id) - end as extent - from bottleneck_duration + when direction in ('N', 'E') + then + lag(is_congested) + over ( + partition by sample_timestamp, freeway, direction, station_type + order by absolute_postmile asc + ) + when direction in ('S', 'W') + then + lead(is_congested) + over ( + partition by sample_timestamp, freeway, direction, station_type + order by absolute_postmile asc + ) + end as upstream_is_congested, + iff(is_congested = upstream_is_congested, 0, 1) as congestion_status_change, + from bottleneck_start +), + +congestion_events as ( + select + *, + sum(congestion_status_change) + over ( + partition by sample_timestamp, freeway, direction, station_type + order by absolute_postmile asc + rows between unbounded preceding and current row + ) as congestion_sequence + from congestion +), + +congestion_length as ( + select + *, + sum(congestion_length) over ( + partition by sample_timestamp, freeway, direction, station_type, congestion_sequence + order by absolute_postmile asc + rows between current row and unbounded following -- This is a bug: should be preceding in some directions, following in others + ) as bottleneck_extent + from congestion_events + qualify is_bottleneck = true -- TODO: also filter if upstream is a bottleneck start? ) -select * from extent_cte +select * from congestion_length \ No newline at end of file diff --git a/transform/models/intermediate/performance/int_performance__bottleneck_start.sql b/transform/models/intermediate/performance/int_performance__bottleneck_start.sql index 800ec5b6..8d0f81d0 100644 --- a/transform/models/intermediate/performance/int_performance__bottleneck_start.sql +++ b/transform/models/intermediate/performance/int_performance__bottleneck_start.sql @@ -12,7 +12,7 @@ station_five_minute as ( station_id, sample_date, sample_timestamp, - speed_five_mins, + nullifzero(speed_five_mins) as speed_five_mins, freeway, direction, station_type, From 940fb9ff6d497f46be3b0e8d5c6236d9d3039632 Mon Sep 17 00:00:00 2001 From: Britt Allen Date: Wed, 31 Jul 2024 22:38:07 +0000 Subject: [PATCH 12/22] linting fixes, condensed bottleneck models into one, corrected congested length CTE to account for directional nuance --- .../int_performance__bottleneck_extent.sql | 73 -------- .../int_performance__bottleneck_start.sql | 94 ---------- .../int_performance__bottlenecks.sql | 163 ++++++++++++++++++ 3 files changed, 163 insertions(+), 167 deletions(-) delete mode 100644 transform/models/intermediate/performance/int_performance__bottleneck_extent.sql delete mode 100644 transform/models/intermediate/performance/int_performance__bottleneck_start.sql create mode 100644 transform/models/intermediate/performance/int_performance__bottlenecks.sql diff --git a/transform/models/intermediate/performance/int_performance__bottleneck_extent.sql b/transform/models/intermediate/performance/int_performance__bottleneck_extent.sql deleted file mode 100644 index 48360e5c..00000000 --- a/transform/models/intermediate/performance/int_performance__bottleneck_extent.sql +++ /dev/null @@ -1,73 +0,0 @@ -{{ config( - materialized="incremental", - cluster_by=["sample_date"], - unique_key=["station_id", "sample_date", "sample_timestamp"], - snowflake_warehouse = get_snowflake_refresh_warehouse(small="XS", big="XL") -) }} - -with - -bottleneck_start as ( - select * from {{ ref ("int_performance__bottleneck_start") }} - where {{ make_model_incremental('sample_date') }} -), - -congestion as ( - select - *, - speed_five_mins < 40 as is_congested, - - /* Create a helper length field which is zero if we don't consider this station - congested and the station length if we do. This will be summed later to get - the congestion extent */ - iff(is_congested, length, 0) as congestion_length, - - /* Absolute postmile increases going north and east. When the direction of the freeway for a - station is north or east, the "upstream" station has a smaller postmile, and we need to lag - to get the speed there. When the direction is west or south, the "upstream" station has a - larger postmile, and we need to lead to get the speed there. */ - case - when direction in ('N', 'E') - then - lag(is_congested) - over ( - partition by sample_timestamp, freeway, direction, station_type - order by absolute_postmile asc - ) - when direction in ('S', 'W') - then - lead(is_congested) - over ( - partition by sample_timestamp, freeway, direction, station_type - order by absolute_postmile asc - ) - end as upstream_is_congested, - iff(is_congested = upstream_is_congested, 0, 1) as congestion_status_change, - from bottleneck_start -), - -congestion_events as ( - select - *, - sum(congestion_status_change) - over ( - partition by sample_timestamp, freeway, direction, station_type - order by absolute_postmile asc - rows between unbounded preceding and current row - ) as congestion_sequence - from congestion -), - -congestion_length as ( - select - *, - sum(congestion_length) over ( - partition by sample_timestamp, freeway, direction, station_type, congestion_sequence - order by absolute_postmile asc - rows between current row and unbounded following -- This is a bug: should be preceding in some directions, following in others - ) as bottleneck_extent - from congestion_events - qualify is_bottleneck = true -- TODO: also filter if upstream is a bottleneck start? -) - -select * from congestion_length \ No newline at end of file diff --git a/transform/models/intermediate/performance/int_performance__bottleneck_start.sql b/transform/models/intermediate/performance/int_performance__bottleneck_start.sql deleted file mode 100644 index 8d0f81d0..00000000 --- a/transform/models/intermediate/performance/int_performance__bottleneck_start.sql +++ /dev/null @@ -1,94 +0,0 @@ -{{ config( - materialized="incremental", - cluster_by=["sample_date"], - unique_key=["station_id", "sample_date", "sample_timestamp"], - snowflake_warehouse = get_snowflake_refresh_warehouse(small="XS") -) }} - -with - -station_five_minute as ( - select - station_id, - sample_date, - sample_timestamp, - nullifzero(speed_five_mins) as speed_five_mins, - freeway, - direction, - station_type, - absolute_postmile, - length - from {{ ref ("int_performance__station_metrics_agg_five_minutes") }} - where - {{ make_model_incremental('sample_date') }} - and station_type in ('ML', 'HV') -), - -calcs as ( - select - *, - - /*Absolute postmile increases going north and east. When the direction of the freeway for a - station is north or east, the "upstream" station has a smaller postmile, and we need to lag - to get the speed there. When the direction is west or south, the "upstream" station has a - larger postmile, and we need to lead to get the speed there. */ - - speed_five_mins - lag(speed_five_mins) - over (partition by sample_timestamp, freeway, direction, station_type order by absolute_postmile asc) - as speed_delta_ne, - - speed_five_mins - lead(speed_five_mins) - over (partition by sample_timestamp, freeway, direction, station_type order by absolute_postmile asc) - as speed_delta_sw, - - absolute_postmile - lag(absolute_postmile) - over (partition by sample_timestamp, freeway, direction, station_type order by absolute_postmile asc) - as distance_delta_ne, - - absolute_postmile - lead(absolute_postmile) - over (partition by sample_timestamp, freeway, direction, station_type order by absolute_postmile asc) - as distance_delta_sw - - from station_five_minute -), - -bottleneck_criteria as ( - select - *, - case - when - speed_five_mins < 40 - and abs(distance_delta_ne) < 3 - and speed_delta_ne <= -20 - and (direction = 'N' or direction = 'E') - then 1 - when - speed_five_mins < 40 - and abs(distance_delta_sw) < 3 - and speed_delta_sw <= -20 - and (direction = 'S' or direction = 'W') - then 1 - else 0 - end as bottleneck_check - - from calcs -), - -temporal_extent_check as ( - select - *, - sum(bottleneck_check) over ( - partition by station_id, sample_date - order by sample_timestamp asc rows between current row and 6 following - ) as bottleneck_check_summed - from bottleneck_criteria -), - -temporal_extent as ( - select - * exclude (bottleneck_check, bottleneck_check_summed), - iff(bottleneck_check_summed >= 5, true, false) as is_bottleneck - from temporal_extent_check -) - -select * from temporal_extent diff --git a/transform/models/intermediate/performance/int_performance__bottlenecks.sql b/transform/models/intermediate/performance/int_performance__bottlenecks.sql new file mode 100644 index 00000000..05e62f75 --- /dev/null +++ b/transform/models/intermediate/performance/int_performance__bottlenecks.sql @@ -0,0 +1,163 @@ +{{ config( + materialized="incremental", + cluster_by=["sample_date"], + unique_key=["station_id", "sample_date", "sample_timestamp"], + snowflake_warehouse = get_snowflake_refresh_warehouse(small="XS") +) }} + +with + +station_five_minute as ( + select + station_id, + sample_date, + sample_timestamp, + nullifzero(speed_five_mins) as speed_five_mins, + freeway, + direction, + station_type, + absolute_postmile, + length + from {{ ref ("int_performance__station_metrics_agg_five_minutes") }} + where + {{ make_model_incremental('sample_date') }} + and station_type in ('ML', 'HV') +), + +calcs as ( + select + *, + + /*Absolute postmile increases going north and east. When the direction of the freeway for a + station is north or east, the "upstream" station has a smaller postmile, and we need to lag + to get the speed there. When the direction is west or south, the "upstream" station has a + larger postmile, and we need to lead to get the speed there. */ + + speed_five_mins - lag(speed_five_mins) + over (partition by sample_timestamp, freeway, direction, station_type order by absolute_postmile asc) + as speed_delta_ne, + + speed_five_mins - lead(speed_five_mins) + over (partition by sample_timestamp, freeway, direction, station_type order by absolute_postmile asc) + as speed_delta_sw, + + absolute_postmile - lag(absolute_postmile) + over (partition by sample_timestamp, freeway, direction, station_type order by absolute_postmile asc) + as distance_delta_ne, + + absolute_postmile - lead(absolute_postmile) + over (partition by sample_timestamp, freeway, direction, station_type order by absolute_postmile asc) + as distance_delta_sw + + from station_five_minute +), + +bottleneck_criteria as ( + select + *, + case + when + speed_five_mins < 40 + and abs(distance_delta_ne) < 3 + and speed_delta_ne <= -20 + and (direction = 'N' or direction = 'E') + then 1 + when + speed_five_mins < 40 + and abs(distance_delta_sw) < 3 + and speed_delta_sw <= -20 + and (direction = 'S' or direction = 'W') + then 1 + else 0 + end as bottleneck_check + + from calcs +), + +temporal_extent_check as ( + select + *, + sum(bottleneck_check) over ( + partition by station_id, sample_date + order by sample_timestamp asc rows between current row and 6 following + ) as bottleneck_check_summed + from bottleneck_criteria +), + +temporal_extent as ( + select + * exclude (bottleneck_check, bottleneck_check_summed), + iff(bottleneck_check_summed >= 5, true, false) as is_bottleneck + from temporal_extent_check +), + +congestion as ( + select + *, + speed_five_mins < 40 as is_congested, + + /* Create a helper length field which is zero if we don't consider this station + congested and the station length if we do. This will be summed later to get + the congestion extent */ + iff(is_congested, length, 0) as congestion_length, + + /* Absolute postmile increases going north and east. When the direction of the freeway for a + station is north or east, the "upstream" station has a smaller postmile, and we need to lag + to get the speed there. When the direction is west or south, the "upstream" station has a + larger postmile, and we need to lead to get the speed there. */ + case + when direction in ('N', 'E') + then + lag(is_congested) + over ( + partition by sample_timestamp, freeway, direction, station_type + order by absolute_postmile asc + ) + when direction in ('S', 'W') + then + lead(is_congested) + over ( + partition by sample_timestamp, freeway, direction, station_type + order by absolute_postmile asc + ) + end as upstream_is_congested, + iff(is_congested = upstream_is_congested, 0, 1) as congestion_status_change + from temporal_extent +), + +congestion_events as ( + select + *, + sum(congestion_status_change) + over ( + partition by sample_timestamp, freeway, direction, station_type + order by absolute_postmile asc + rows between unbounded preceding and current row + ) as congestion_sequence + from congestion +), + +congestion_length as ( + select + *, + case + when direction in ('N', 'E') + then + sum(congestion_length) over ( + partition by sample_timestamp, freeway, direction, station_type, congestion_sequence + order by absolute_postmile asc + rows between unbounded preceding and current row + ) + when direction in ('S', 'W') + then + sum(congestion_length) over ( + partition by sample_timestamp, freeway, direction, station_type, congestion_sequence + order by absolute_postmile asc + rows between current row and unbounded following + ) + end as bottleneck_extent + from congestion_events + qualify is_bottleneck = true -- TODO: also filter if upstream is a bottleneck start? +) + +select * from congestion_length From 5486b4515893f4aae5e6f9db7441e64f7c1bb7d5 Mon Sep 17 00:00:00 2001 From: Britt Allen Date: Wed, 31 Jul 2024 22:41:16 +0000 Subject: [PATCH 13/22] updated yaml --- transform/models/intermediate/performance/_performance.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transform/models/intermediate/performance/_performance.yml b/transform/models/intermediate/performance/_performance.yml index e093479a..78577721 100644 --- a/transform/models/intermediate/performance/_performance.yml +++ b/transform/models/intermediate/performance/_performance.yml @@ -424,7 +424,7 @@ models: description: 50th highest hour volume in the precceding year. - name: K_100 description: 100th highest hour volume in the precceding year. - - name: int_performance__bottleneck_start + - name: int_performance__bottlenecks description: | The PeMS system runs a bottleneck identification algorithm every day. The original algorithm was presented in, "Systematic Identification of Freeway Bottlenecks," by Chen, C., Skabardonis, A., From 68b2b08478d855b75308d91edf2bd6284ae4475d Mon Sep 17 00:00:00 2001 From: Britt Allen Date: Wed, 31 Jul 2024 22:45:39 +0000 Subject: [PATCH 14/22] added a precious newline at the end of the file --- .../int_performance__station_metrics_agg_five_minutes.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql b/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql index 660173f7..92017855 100644 --- a/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql +++ b/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql @@ -30,4 +30,4 @@ station_aggregated_speed as ( group by station_id, sample_date, sample_timestamp ) -select * from station_aggregated_speed \ No newline at end of file +select * from station_aggregated_speed From dc6c78b7d2105da04db6e72b1bedbaaa0d1e1a94 Mon Sep 17 00:00:00 2001 From: Britt Allen Date: Thu, 1 Aug 2024 21:16:53 +0000 Subject: [PATCH 15/22] added on schema change flag to account for the addition of the length column --- .../int_performance__station_metrics_agg_five_minutes.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql b/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql index 92017855..54305a24 100644 --- a/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql +++ b/transform/models/intermediate/performance/int_performance__station_metrics_agg_five_minutes.sql @@ -1,5 +1,6 @@ {{ config( materialized="incremental", + on_schema_change="append_new_columns", cluster_by=["sample_date"], unique_key=["station_id", "sample_date", "sample_timestamp"], snowflake_warehouse = get_snowflake_refresh_warehouse(big="XL") From 325b2733d7bd05bb876aff7f3ae8e5ff48fa7cb6 Mon Sep 17 00:00:00 2001 From: Hang Gao Date: Tue, 6 Aug 2024 20:22:33 +0000 Subject: [PATCH 16/22] test commit --- .../intermediate/performance/int_performance__bottlenecks.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/transform/models/intermediate/performance/int_performance__bottlenecks.sql b/transform/models/intermediate/performance/int_performance__bottlenecks.sql index 05e62f75..258a7444 100644 --- a/transform/models/intermediate/performance/int_performance__bottlenecks.sql +++ b/transform/models/intermediate/performance/int_performance__bottlenecks.sql @@ -157,7 +157,8 @@ congestion_length as ( ) end as bottleneck_extent from congestion_events - qualify is_bottleneck = true -- TODO: also filter if upstream is a bottleneck start? + qualify is_bottleneck = true and congestion_status_change = 1 -- TODO: also filter if upstream is a bottleneck start? + ) select * from congestion_length From 314648a6527b1ddcad829a5e1b6369a6610783a2 Mon Sep 17 00:00:00 2001 From: Hang Gao Date: Tue, 6 Aug 2024 20:24:01 +0000 Subject: [PATCH 17/22] undo my changes --- .../intermediate/performance/int_performance__bottlenecks.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transform/models/intermediate/performance/int_performance__bottlenecks.sql b/transform/models/intermediate/performance/int_performance__bottlenecks.sql index 258a7444..80b8db0f 100644 --- a/transform/models/intermediate/performance/int_performance__bottlenecks.sql +++ b/transform/models/intermediate/performance/int_performance__bottlenecks.sql @@ -157,7 +157,7 @@ congestion_length as ( ) end as bottleneck_extent from congestion_events - qualify is_bottleneck = true and congestion_status_change = 1 -- TODO: also filter if upstream is a bottleneck start? + qualify is_bottleneck = true -- TODO: also filter if upstream is a bottleneck start? ) From 0dadafb5ee49c82158d70677272da2a5abeee27f Mon Sep 17 00:00:00 2001 From: Britt Allen Date: Tue, 6 Aug 2024 23:19:52 +0000 Subject: [PATCH 18/22] removed trailing whitespace --- .../intermediate/performance/int_performance__bottlenecks.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transform/models/intermediate/performance/int_performance__bottlenecks.sql b/transform/models/intermediate/performance/int_performance__bottlenecks.sql index 80b8db0f..bc169802 100644 --- a/transform/models/intermediate/performance/int_performance__bottlenecks.sql +++ b/transform/models/intermediate/performance/int_performance__bottlenecks.sql @@ -158,7 +158,7 @@ congestion_length as ( end as bottleneck_extent from congestion_events qualify is_bottleneck = true -- TODO: also filter if upstream is a bottleneck start? - + ) select * from congestion_length From b32cc7fc9c65a71344b77f46ada268a86396abfb Mon Sep 17 00:00:00 2001 From: Hang Gao Date: Tue, 20 Aug 2024 23:00:46 +0000 Subject: [PATCH 19/22] Created lat and long columns in the bottleneck performance metrics for visualization --- .../int_performance__bottlenecks.sql | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/transform/models/intermediate/performance/int_performance__bottlenecks.sql b/transform/models/intermediate/performance/int_performance__bottlenecks.sql index bc169802..b42b9c2d 100644 --- a/transform/models/intermediate/performance/int_performance__bottlenecks.sql +++ b/transform/models/intermediate/performance/int_performance__bottlenecks.sql @@ -7,7 +7,7 @@ with -station_five_minute as ( +station_metrics as ( select station_id, sample_date, @@ -24,6 +24,25 @@ station_five_minute as ( and station_type in ('ML', 'HV') ), +station_config as ( + select + station_id, + max(latitude) as lat, + min(longitude) as long + from {{ ref("int_vds__station_config") }} + group by station_id +), + +station_five_minute as ( + select + m.*, + c.lat, + c.long + from station_metrics as m + left join station_config as c + on m.station_id = c.station_id +), + calcs as ( select *, From 542012615d0ee5873ecdfd05f406e2b833487b98 Mon Sep 17 00:00:00 2001 From: Hang Gao Date: Wed, 28 Aug 2024 20:45:33 +0000 Subject: [PATCH 20/22] Modified the bottleneck models using upstream methods and provided column descriptions of int_performance__bottlenecks. Note that these two models (upstream and downstream) can be easily switched, so I prefer not creating a new upstream model. For the ArcGIS visualization needed information (such as lat, long, and average_extent during different time periods), I will create the final table in Mart level to join them. --- .../intermediate/performance/_performance.yml | 25 +++++++++++++++- .../int_performance__bottlenecks.sql | 29 ++++--------------- 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/transform/models/intermediate/performance/_performance.yml b/transform/models/intermediate/performance/_performance.yml index 78577721..a0f787dd 100644 --- a/transform/models/intermediate/performance/_performance.yml +++ b/transform/models/intermediate/performance/_performance.yml @@ -433,7 +433,7 @@ models: This model identifies bottlenecks at every station. A bottleneck is defined by the following conditions: 1. There is a drop in speed of at least 20 mph between stations during the same time - 2. The speed at the current station (downstream station) is less than 40 mph. + 2. The speed at the current station (upstream station) is less than 40 mph. 3. The stations are less than 3 miles apart. 4. The speed drop persists for at least 5 out of any 7 contiguous 5-minute data points. @@ -469,3 +469,26 @@ models: description: | A boolean value that evaluates to True when all criteria for a bottleneck is met for at least 5 rows in a forward-looking window of seven, otherwise it will give a value of False. + - name: IS_CONGESTED + description: + A boolean value that evaluates to True when the speed of a station is below 40 mph in a 5-minute period, + otherwise it will give a value of False. + - name: CONGESTION_LENGTH + description: Returns station length when the station is congested, otherwise it will return 0. + - name: UPSTREAM_IS_CONGESTED + description: + A boolean value that evaluates to True when the upstream station is also congested, otherwise it will + give a value of False. + - name: CONGESTION_STATUS_CHANGE + description: + A binary value that evaluates to 1 when the congestion status changes between stations, either + from congested to uncongested or uncongested to congested. + - name: CONGESTION_SEQUENCE + description: + Calculates the summation of congestion_status_change values accumulatively. For different stations + with same sequence values will maintain the same congestion status (either congested or uncongested). + - name: BOTTLENECK_EXTENT + description: + Calculates the congestion region starting from the bottleneck location towards upstream adjacent + congested stations, which is the summation of congestion lengths with same congestion sequence values. + diff --git a/transform/models/intermediate/performance/int_performance__bottlenecks.sql b/transform/models/intermediate/performance/int_performance__bottlenecks.sql index b42b9c2d..f6c9b131 100644 --- a/transform/models/intermediate/performance/int_performance__bottlenecks.sql +++ b/transform/models/intermediate/performance/int_performance__bottlenecks.sql @@ -7,7 +7,7 @@ with -station_metrics as ( +station_five_minute as ( select station_id, sample_date, @@ -24,25 +24,6 @@ station_metrics as ( and station_type in ('ML', 'HV') ), -station_config as ( - select - station_id, - max(latitude) as lat, - min(longitude) as long - from {{ ref("int_vds__station_config") }} - group by station_id -), - -station_five_minute as ( - select - m.*, - c.lat, - c.long - from station_metrics as m - left join station_config as c - on m.station_id = c.station_id -), - calcs as ( select *, @@ -52,19 +33,19 @@ calcs as ( to get the speed there. When the direction is west or south, the "upstream" station has a larger postmile, and we need to lead to get the speed there. */ - speed_five_mins - lag(speed_five_mins) + speed_five_mins - lead(speed_five_mins) over (partition by sample_timestamp, freeway, direction, station_type order by absolute_postmile asc) as speed_delta_ne, - speed_five_mins - lead(speed_five_mins) + speed_five_mins - lag(speed_five_mins) over (partition by sample_timestamp, freeway, direction, station_type order by absolute_postmile asc) as speed_delta_sw, - absolute_postmile - lag(absolute_postmile) + absolute_postmile - lead(absolute_postmile) over (partition by sample_timestamp, freeway, direction, station_type order by absolute_postmile asc) as distance_delta_ne, - absolute_postmile - lead(absolute_postmile) + absolute_postmile - lag(absolute_postmile) over (partition by sample_timestamp, freeway, direction, station_type order by absolute_postmile asc) as distance_delta_sw From 8477edf70475d4f40202044d54bfe283898042f7 Mon Sep 17 00:00:00 2001 From: Hang Gao Date: Fri, 30 Aug 2024 19:47:29 +0000 Subject: [PATCH 21/22] add supplemental descriptions for bottleneck modeling and resolve conflicts --- .../intermediate/performance/_performance.yml | 37 +++++++++++++++---- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/transform/models/intermediate/performance/_performance.yml b/transform/models/intermediate/performance/_performance.yml index 39850630..91fd7450 100644 --- a/transform/models/intermediate/performance/_performance.yml +++ b/transform/models/intermediate/performance/_performance.yml @@ -457,6 +457,27 @@ models: entire duration and spatial extent of the bottleneck. The delay is calculated with respect to a threshold speed of 60 mph. columns: + - name: STATION_ID + description: | + An integer value that uniquely indentifies a station. + Use this value to 'join' other files or tables that contain the Station ID value. + - name: SAMPLE_DATE + description: The date associated with daily aggregated data samples. + - name: SAMPLE_TIMESTAMP + description: The timestamp of the start for the 5 minute aggregated samples. + - name: SPEED_FIVE_MINS + description: | + Actual reported speed if available otherwise the preliminary speed calculation + in miles/hour based on the simplified version of the speed formula located at + https://pems.dot.ca.gov/Papers/vanzwet_gfactor.pdf + - name: FREEWAY + description: The freeway where the VDS is located. + - name: DIRECTION + description: A string indicating the freeway direction of a specific VDS. Directions are N, E, S or W. + - name: STATION_TYPE + description: Two character string identify the VDS type. + - name: LENGTH + description: length of the station. - name: DISTANCE_DELTA_NE description: Calculates the delta between postmiles that have a direction of N or E. - name: DISTANCE_DELTA_SW @@ -476,7 +497,7 @@ models: - name: CONGESTION_LENGTH description: Returns station length when the station is congested, otherwise it will return 0. - name: UPSTREAM_IS_CONGESTED - description: + description: | A boolean value that evaluates to True when the upstream station is also congested, otherwise it will give a value of False. - name: CONGESTION_STATUS_CHANGE @@ -491,13 +512,13 @@ models: description: | Calculates the congestion region starting from the bottleneck location towards upstream adjacent congested stations, which is the summation of congestion lengths with same congestion sequence values. - - name: int_performance__detector_metrics_agg_hourly - description: | - hourly aggregation of volume, occupancy and speed along with delays and lost productivity by - each detetcor lane. This metrics will measure the hourly performance of the state - highway system at the detecctor level.This can be used for daily aggregation of PeMS performance - metrics at the detector level. - columns: + - name: int_performance__detector_metrics_agg_hourly + description: | + hourly aggregation of volume, occupancy and speed along with delays and lost productivity by + each detetcor lane. This metrics will measure the hourly performance of the state + highway system at the detecctor level.This can be used for daily aggregation of PeMS performance + metrics at the detector level. + columns: - name: STATION_ID description: | An integer value that uniquely indentifies a station. From 0f5f5872727ea699a181dffb973a63f41c6e1ae8 Mon Sep 17 00:00:00 2001 From: Hang Gao Date: Fri, 30 Aug 2024 20:29:15 +0000 Subject: [PATCH 22/22] resolve whitespace issues --- transform/models/intermediate/performance/_performance.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transform/models/intermediate/performance/_performance.yml b/transform/models/intermediate/performance/_performance.yml index 91fd7450..5e8b02e9 100644 --- a/transform/models/intermediate/performance/_performance.yml +++ b/transform/models/intermediate/performance/_performance.yml @@ -510,7 +510,7 @@ models: with same sequence values will maintain the same congestion status (either congested or uncongested). - name: BOTTLENECK_EXTENT description: | - Calculates the congestion region starting from the bottleneck location towards upstream adjacent + Calculates the congestion region starting from the bottleneck location towards upstream adjacent congested stations, which is the summation of congestion lengths with same congestion sequence values. - name: int_performance__detector_metrics_agg_hourly description: |