CityofToronto / bdit_data-sources

Data sources used by the Big Data Innovation Team
https://github.com/orgs/CityofToronto/teams/bigdatainnovationteam
GNU General Public License v3.0
39 stars 8 forks source link

New model being deployed to increase bike accuracy #846

Closed radumas closed 8 months ago

radumas commented 9 months ago

Being deployed to the following locations after noon today

radumas commented 9 months ago

As mentioned elsewhere (in relation to ecocounter), we should probably log these model updates to a table (start_date, end_date, intersection, notes). Though there is likely going to be some squishiness to them.

Nate-Wessel commented 9 months ago

See what we did / are doing for Ecocounter in #831.

I'd love to make this as consistent as possible with whatever we end up doing for Miovision. (This issue is about Miovision locations, right?)

radumas commented 9 months ago

Noting a change was deployed to the following locations on 2024-02-06 which should not affect counting

Bay st. & Front Bay St. & Wellington St Bay St. & King St. Bay st. & Adelaide:
Bay St. & Richmond St. Bay St. & Queen St.

gabrielwol commented 8 months ago

Drafting these discontinuities up as test cases for new table:

WITH model_changes AS (
    SELECT intersection_name, start_date, notes, classification_uid FROM (VALUES
        ('Bayview Avenue and River Street', '2024-01-29 12:00:00'::timestamp, 'New model being deployed to increase bike accuracy.'),
        ('Bloor / Bay', '2024-01-29 12:00:00'::timestamp, 'New model being deployed to increase bike accuracy.'),
        ('Bloor Street West and Dufferin Street', '2024-01-29 12:00:00'::timestamp, 'New model being deployed to increase bike accuracy.'),
        ('College / University', '2024-01-29 12:00:00'::timestamp, 'New model being deployed to increase bike accuracy.'),
        ('Danforth / Broadview', '2024-01-29 12:00:00'::timestamp, 'New model being deployed to increase bike accuracy.'),
        ('Danforth / Logan', '2024-01-29 12:00:00'::timestamp, 'New model being deployed to increase bike accuracy.'),
        ('Dundas / Bloor', '2024-01-29 12:00:00'::timestamp, 'New model being deployed to increase bike accuracy.'),
        ('Greenwood / Danforth', '2024-01-29 12:00:00'::timestamp, 'New model being deployed to increase bike accuracy.'),
        ('Harbord Street/St. George Street/Hoskin Street', '2024-01-29 12:00:00'::timestamp, 'New model being deployed to increase bike accuracy.'),
        ('Queen / University', '2024-01-29 12:00:00'::timestamp, 'New model being deployed to increase bike accuracy.'),
        ('Runnymede / Bloor', '2024-01-29 12:00:00'::timestamp, 'New model being deployed to increase bike accuracy.'),
      ('Sheppard Avenue West and Keele Street', '2024-01-29 12:00:00'::timestamp, 'New model being deployed to increase bike accuracy.'),
        ('Yonge Street / Davenport Road / Church St', '2024-01-29 12:00:00'::timestamp, 'New model being deployed to increase bike accuracy.')
    ) AS model_changes(intersection_name, start_date, notes)
    CROSS JOIN (VALUES (2), (10)) AS classifications(classification_uid)
    UNION
    SELECT intersection_name, start_date, notes, classification_uid FROM
    (VALUES
        ('Front / Bay', '2024-02-06 12:00:00'::timestamp, 'A model change was deployed which should not affect counting.', null::integer),
        ('Wellington / Bay', '2024-02-06 12:00:00'::timestamp, 'A model change was deployed which should not affect counting.', null::integer),
        ('King / Bay', '2024-02-06 12:00:00'::timestamp, 'A model change was deployed which should not affect counting.', null::integer),
        ('Adelaide / Bay', '2024-02-06 12:00:00'::timestamp, 'A model change was deployed which should not affect counting.', null::integer),
        ('Richmond / Bay', '2024-02-06 12:00:00'::timestamp, 'A model change was deployed which should not affect counting.', null::integer),
        ('Queen / Bay', '2024-02-06 12:00:00'::timestamp, 'A model change was deployed which should not affect counting.', null::integer)
    ) AS model_changes2(intersection_name, start_date, notes, classification_uid)
)

INSERT INTO miovision_api.breaks(intersection_uid, classification_uid, break_time, give_or_take, notes)
SELECT intersection_uid, classification_uid, start_date AS break, interval '12 hours' AS give_or_take, notes
FROM model_changes
LEFT JOIN miovision_api.intersections USING (intersection_name)
gabrielwol commented 8 months ago

Drafting these discontinuities up as test cases for new table: ....

Added ✅