openelections / openelections-core

Core repo for election results data acquisition, transformation and output.
MIT License
176 stars 96 forks source link

Baking (raw at least) doesn't include "special" in filename #273

Closed nbdavies closed 5 years ago

nbdavies commented 6 years ago

I noticed that when baking results, at least with the "raw" option, none of the output files have "special" in the filename, even if the results are for a special election.

For instance, there was a special primary election on 2012-11-06 (same day as the scheduled general). The results for that special primary write to this file name:

20121106__wi__primary__precinct__raw.csv

Where this really causes problems is when the special election occurs on the same day as a scheduled election of the same type (primary and special primary, or generate and special general).

This occurred twice in 2013: there special primary was on 2013-02-19, on the same day as a regularly scheduled primary. And then the special general was 2013-04-02, on the same day as a regularly scheduled general election (Wisconsin statute requires the election dates to line up when possible.)

The result was that the bake task only produced two files, when it ought to have produced four:

20130219__wi__primary__precinct__raw.csv 20130402__wi__general__precinct__raw.csv

These files each include the results of both elections on that day.

nbdavies commented 5 years ago

When I wrote up this issue, I think I hadn't noticed that the baked raw output includes a column to denote special election results. That means special doesn't need to be in the filename, and therefore special elections don't need to be split out to separate csv files.

I checked some Wisconsin situations where special elections took place on the same day as regular elections. When they're both the same type (primary/primary or general/general), then there's one file produced, which has the regular results and special results in it, with the special results marked with True. And when they're different types (primary/general or general/primary), the elections produce separate files. So that's all correct.

Sorry to bug ya! :-)