insight-lane / crash-model

Build a crash prediction modeling application that leverages multiple data sources to generate a set of dynamic predictions we can use to identify potential trouble spots and direct timely safety interventions.
https://insightlane.org
MIT License
112 stars 40 forks source link

Add timezone handling, and fix the way start/end dates work #211

Closed j-t-t closed 5 years ago

j-t-t commented 5 years ago

Since Waze data is in UTC, it became necessary to handle time zones, so I updated the standardization script to calculate and store the datetime as utc. This handles times that are already in UTC (such as see click fix data) as well as local times.

In order to this, I added a time zone field to the config file. When initialize_city is run, this is populated with the user's local timezone, and would need to be updated if that isn't the city's timezone.

While I was at it, I also changed the start_year and end_year filters on crashes to be startdate and enddate, and inclusive, so 1/1/2016 start and 12/31/2016 end means everything in 2016.

codecov[bot] commented 5 years ago

Codecov Report

Merging #211 into master will increase coverage by 0.38%. The diff coverage is 34.65%.

@@            Coverage Diff             @@
##           master     #211      +/-   ##
==========================================
+ Coverage   51.82%   52.21%   +0.38%     
==========================================
  Files          29       29              
  Lines        2931     2959      +28     
==========================================
+ Hits         1519     1545      +26     
- Misses       1412     1414       +2