Skip to content

Commit e051c5a

Browse files
Merge pull request #742 from ElectionDataAnalysis/issue730-get-started
Issue730 get started
2 parents abdf707 + 6043305 commit e051c5a

90 files changed

Lines changed: 2677 additions & 6205 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ This repository provides tools for consolidation and analysis of raw election re
1010
* json (following NIST Election Results Reporting Common Data Format V2)
1111
* Analysis:
1212
* Curates one-county outliers of interest
13-
* Calculates difference-in-difference for reaults available by vote type
13+
* Calculates difference-in-difference for results available by vote type
1414
* Visualization:
1515
* Scatter plots
1616
* Bar charts
1717

1818
# Target Audience
19-
This system is intended to be of use to candidates and campaigns, election officials, students of politics and elections, and anyone else who is interested in assembling and understanding election results.
19+
This system is intended to be of use to news media, campaigns, election officials, students of politics and elections, and anyone else who is interested in assembling and understanding election results.
2020

2121
# How to Contribute Code
2222
Please contribute code that works in python 3.9, with the package versions specified in [requirements.txt](requirements.txt). We follow the [black](https://pypi.org/project/black/) format.
@@ -36,9 +36,15 @@ If you are a potential end user -- an election official, political scientist or
3636
If you are interested in contributing, or just staying updated on the progress of this project, please [contact Stephanie Singer](http://symmetrysinger.com/index.php?id=contact).
3737

3838
# How to use the app
39-
Detailed instructions can be found [here](docs/User_Guide.md).
40-
41-
39+
See [documentation directory](docs), which includes
40+
* for users
41+
* [Installation instructions](docs/Installation.md)
42+
* Instructions for a [sample dataloading session](docs/Sample_Dataloading_Session.md)
43+
* Detailed [User Guide](docs/User_Guide.md)
44+
* for developers
45+
* [Information about the code](docs/About_the_Code.md)
46+
* [Information about the tests](docs/Testing_Code_with_pytest.md)
47+
4248
# Contributors
4349
* [Stephanie Singer](http://campaignscientific.com/), Hatfield School of Government (Portland State University), former Chair, Philadelphia County Board of Elections
4450
* Janaki Raghuram Srungavarapu, Hatfield School of Government (Portland State University)
@@ -48,7 +54,7 @@ Detailed instructions can be found [here](docs/User_Guide.md).
4854
* Elliot Meyerson
4955

5056
# Funding
51-
Funding provided October 2019 - September 2021 by the National Science Foundation
57+
Funding provided October 2019 - November 2021 by the National Science Foundation
5258
* Award #1936809, "EAGER: Data Science for Election Verification"
5359
* Award #2027089, "RAPID: Election Result Anomaly Detection for 2020"
5460
Data collection and consolidation for the 2020 US General Election funded in part by the Verified Voting Foundation.

docs/Sample_Dataloading_Session.md

Lines changed: 351 additions & 0 deletions
Large diffs are not rendered by default.

docs/Testing_Code_with_pytest.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Results files for dataloading tests
2+
The dataloading tests rely on having some raw results data to load. And the results data should be various enough to test the various components of the data-loading code. In other words, effective testing requires a reasonable variety of input files. The repository does not contain sufficient results data for testing. A test set is available in a separate repository, [***TODO](***TODO). If [test_dataloading_by_ej.py](../tests/dataloading_tests/test_dataloading_by_ej.py) does not find results data, it will default to downloading the files from that repository.
3+
4+
# Sample Testing Session
5+
6+
## Directory and File Structure
7+
Call the tests from a working directory with the following structure and files:
8+
```
9+
.
10+
+-- input_results
11+
| +-- Alabama
12+
| | + <Alabama results file>
13+
| | + <maybe another Alabama results file>
14+
| +-- Alaska
15+
| | + <Alaska results file>
16+
| +-- American-Samoa
17+
| | + <American Samoa results file>
18+
| +-- <etc>
19+
|
20+
+-- reports_and_plots
21+
+-- run_time.ini
22+
```
23+
The file `run_time.ini` can be the same as in the [Sample Dataloading Session](Sample_Dataloading_Session.md).
24+
25+
## Note on dataloading tests
26+
The tests in [test_dataloading_by_ej.py](../tests/dataloading_tests/test_dataloading_by_ej.py) will attempt to load all raw results files in `input_results` that are specified by some file in the [`ini_file_for_results` directory](../src/ini_files_for_results). You can check which jurisdictions had files loaded:
27+
* if the test is successful, look at the `compare_*` directories in the `reports_and_plots` directory.
28+
* if the test fails, look in the output from the test.
29+
30+
## Running the tests
31+
You will need pytest to be installed on your system (see [pytest installation instructions](https://docs.pytest.org/en/6.2.x/getting-started.html) if necessary). Commands are run from the shell
32+
* dataloading routines: `pytest ~/PycharmProjects/electiondata/tests/dataloading_tests`
33+
* jurisdiction prep routines: `pytest ~/PycharmProjects/electiondata/tests/jurisdiction_prepper_tests/`
34+
* analysis routines: `pytest ~/PycharmProjects/electiondata/tests/analyzer_tests/ `

0 commit comments

Comments
 (0)