Closed alicefeng closed 5 years ago
Can you talk in a little more detail about what you're trying to do in standardize_crashes? It sort of looked like the main goal was to output your new crash rollup file. Is there a purpose to taking out those blocks of code
It looks like you took datadir and city out as arguments to read_standardized_fields because they weren't used in that function. You'll need to update all calls to read_standardized_fields in src/data_standardization/tests/test_standardize_crashes.py to also remove those arguments.
With regard to your changes to writing the file, I'd move all of what you're adding into its own function, instead of part of it in main and part of it in its own function. It will be easier to write a test that way. Also, please add a description at the top of your new function inside of triple quotes, that says what it does and also gives information about what the arguments are to the function.
I'm not sure what happened with the deleted chunks of code. I did not remove anything from the script, only added to it so something weird happened there. At any rate, I think I've restored all of the deleted lines. I've also moved all of the code for rolling up the crashes into a function except for the part where the geojson file actually gets written.
Let me know if there are any other edits needed.
Added a test for make_crash_rollup
. I used assert_frame_equal
from pandas' testing module to test if the two dataframes were the same. Let me know if it'll cause any problems to use that (it looks like my test passed).
Merging #229 into master will increase coverage by
0.2%
. The diff coverage is80.76%
.
@@ Coverage Diff @@
## master #229 +/- ##
=========================================
+ Coverage 54.63% 54.83% +0.2%
=========================================
Files 34 34
Lines 3324 3350 +26
=========================================
+ Hits 1816 1837 +21
- Misses 1508 1513 +5
Looks great!
@alicefeng is this ready for deployment to the showcase? If so, do we want to try and get https://github.com/Data4Democracy/crash-model/pull/218 merged in at the same time?
@terryf82 Yes, this can be pushed to the showcase! I agree about merging #218 in along with it.
Finally merging in long-awaited improvements to the crash layer in the viz:
crashes_rollup.geojson
in pipeline to enable crash dates to be displayed