Skip to content

Commit 5f17aad

Browse files
Merge pull request #732 from ElectionDataAnalysis/feature-version-2.0.1
Version 2.0.1
2 parents 2596f88 + 9c88af1 commit 5f17aad

117 files changed

Lines changed: 3871 additions & 6895 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.

CODE_OF_CONDUCT.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
# Contributor Code of Conduct
3+
4+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
5+
6+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
7+
8+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
9+
10+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
11+
12+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
13+
14+
This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at https://www.contributor-covenant.org/version/1/0/0/code-of-conduct.html

CONTACT_US.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Contact [Stephanie Singer](http://symmetrysinger.com/index.php?id=contact).

CONTRIBUTING.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
Please note that electiondata is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md).
2+
By contributing to this project,
3+
you agree to abide by its terms.
4+
5+
# Contributing to electiondata development
6+
7+
## Report a Problem
8+
9+
To report a problem, [file an issue on GitHub](https://github.com/ElectionDataAnalysis/electiondata/issues). When filing an issue, the most important thing is to include a minimal
10+
reproducible example so that we can quickly verify the problem, and then figure
11+
out how to fix it. Please include
12+
13+
1. Link to the exact version of electiondata you are using.
14+
15+
1. A copy of your working directory, following the model in the [Sample Session](docs/Sample_Session.md). Include:
16+
* a `run_time.ini` file (Feel free to redact the login information for your local postgres instance.)
17+
* all subdirectories referenced in the `run_time.ini` file.
18+
* If the issue involves loading a particular results data file, be sure to include that file. If possible, avoid submitting large results files -- if your file is precinct-based, for example, see if you can demonstrate the issue with a truncated results file.
19+
* all error and warnings files placed by the system into the `reports_and_plots_dir` specified in `run_time.ini`.
20+
21+
1. A transcript of the python session, where python is called from the working directory.
22+
23+
You can check you have actually made a reproducible example by:
24+
1. creating a virtual environment
25+
1. installing the indicated version of electiondata
26+
1. if files or folders were moved by the system to the archive directory, move them back to the input directory, removing any timestamps from directory names.
27+
1. navigating to the working directory, calling python, and producing the behavior in question.
28+
29+
## Revise the Code
30+
31+
To contribute a change to `electiondata` follow these steps:
32+
33+
1. Create a branch in git and make your changes.
34+
1. Run unit tests to check for broken functionality. See [pytest instructions](docs/Testing_Code_with_pytest.md).
35+
1. Run python `black` to format your code to our standard.
36+
1. Push branch to github and issue pull request (PR).
37+
1. Discuss the pull request.
38+
1. Iterate until either we accept the PR or decide that it's not
39+
a good fit for `electiondata`.
40+
41+
Each of these steps are described in more detail below. This might feel
42+
overwhelming the first time you get set up, but it gets easier with practice.
43+
If you get stuck at any point, feel free to [contact us](CONTACT_US.md) for help.
44+
45+
If you're not familiar with git or github, please read a tutorial such as [https://realpython.com/python-git-github-intro/](https://realpython.com/python-git-github-intro/).
46+
47+
48+
Pull requests will be evaluated against this checklist:
49+
50+
1. __Motivation__. Your pull request should clearly and concisely motivate the
51+
need for change.
52+
53+
1. __Only related changes__. Before you submit your pull request, please
54+
check to make sure that you haven't accidentally included any unrelated
55+
changes. These make it harder to see exactly what's changed, and to
56+
evaluate any unexpected side effects.
57+
58+
Each PR corresponds to a git branch, so if you expect to submit
59+
multiple changes make sure to create multiple branches. If you have
60+
multiple changes that depend on each other, start with the first one
61+
and don't submit any others until the first one has been processed.
62+
63+
1. __Documentation__ Any new parameters or a new functions must be documented both in the code and in the [User Guide](docs/User_Guide.md), [Sample Session](docs/Sample_Session.md) and any other relevant documents. If you're adding a new graphical or analytical feature, please add a short example to [Sample Session](docs/Sample_Session.md).
64+
65+
1. __Tests__ If fixing a bug or adding a new feature to a non-graphical function,
66+
please add a [pytest](https://docs.pytest.org) unit test. Document the new test in [pytest instructions](docs/Testing_Code_with_pytest.md).
67+
68+
This seems like a lot of work but don't worry if your pull request isn't perfect.
69+
Unless you've submitted a few in the
70+
past it's unlikely that your pull request will be accepted as is. All PRs require
71+
review and approval from at least one member of the `electiondata` development team
72+
before merge.
73+

MANIFEST.in

Lines changed: 0 additions & 2 deletions
This file was deleted.

README.md

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,31 @@
11
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4078/badge)](https://bestpractices.coreinfrastructure.org/projects/4078)
22

3-
43
# Overview
5-
This repository hopes to provide reliable tools for consolidation and analysis of raw election results from the most reliable sources -- the election agencies themselves.
4+
This repository provides tools for consolidation and analysis of raw election results from the most reliable sources -- the election agencies themselves.
65
* Consolidation: take as input election results files from a wide variety of sources and load the data into a relational database
7-
* Export: create tab-separated flat export files of results sets rolled up to any desired intermediate geography (e.g., by county, or by congressional district)
8-
* Analysis: provide a variety of analysis tools
9-
* Visualization: provide a variety of visualization tools.
6+
* Export: create consistent-format export files of results sets rolled up to any desired intermediate geography
7+
* tabular (tab-separated text)
8+
* xml (following NIST Election Results Reporting Common Data Format V2)
9+
* json (following NIST Election Results Reporting Common Data Format V2)
10+
* Analysis:
11+
* Curates one-county outliers of interest
12+
* Calculates difference-in-difference for results available by vote type
13+
* Visualization:
14+
* Scatter plots
15+
* Bar charts
1016

1117
# Target Audience
12-
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.
13-
14-
# How to Contribute Code
15-
Please contribute code that works in python 3.7, with the package versions specified in [requirements.txt](requirements.txt). We follow the [black](https://pypi.org/project/black/) format.
16-
17-
# How to Help in Other Ways
18-
If you have skills to contribute to building the system, we can definitely use your help:
19-
* Creating visualizations
20-
* Importing and exporting data via xml feeds
21-
* Preparing for intake of specific states' results files
22-
* Managing collection of data files in real time
23-
* Writing documentation
24-
* Merging other data sets of interest (e.g., demographics)
25-
* Building our open source community
26-
* What else? Let us know!
27-
28-
If you are a potential end user -- an election official, political scientist or campaign consultant, for instance -- we would love to talk with you about what you want to from this system.
29-
30-
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).
18+
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. If you have ideas for using this system or if you would like to stay updated on the progress of this project, [we'd like to hear from you](CONTACT_US.md).
3119

3220
# How to use the app
33-
Detailed instructions can be found [here](docs/User_Guide.md).
34-
21+
See [documentation directory](docs), which includes
22+
* for users
23+
* [Installation instructions](docs/Installation.md)
24+
* Instructions for a [sample dataloading session](docs/Sample_Session.md)
25+
* Detailed [User Guide](docs/User_Guide.md)
26+
27+
# How to Contribute Code
28+
See [CONTRIBUTING.MD](CONTRIBUTING.md).
3529

3630
# Contributors
3731
* [Stephanie Singer](http://campaignscientific.com/), Hatfield School of Government (Portland State University), former Chair, Philadelphia County Board of Elections
@@ -42,9 +36,10 @@ Detailed instructions can be found [here](docs/User_Guide.md).
4236
* Elliot Meyerson
4337

4438
# Funding
45-
Funding provided October 2019 - September 2021 by the National Science Foundation
39+
Funding provided October 2019 - November 2021 by the National Science Foundation
4640
* Award #1936809, "EAGER: Data Science for Election Verification"
4741
* Award #2027089, "RAPID: Election Result Anomaly Detection for 2020"
42+
Data collection and consolidation for the 2020 US General Election funded in part by the Verified Voting Foundation.
4843

4944
# License
5045
See [LICENSE.md](./LICENSE.md)

docs/Installation.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Installation Instructions
2+
3+
## Environment
4+
You will need:
5+
* `python3.9`
6+
* `postgresql`
7+
* all python packages given in [requirements.txt](../requirements.txt), and any packages those packages may require
8+
9+
Not absolutely required, but recommended, is a package manager, such as `homebrew` for macOS.
10+
11+
### python3.9
12+
If your environment has a `python` command without a specified version, that `python` may or may not point to `python3.9`. In linux-flavored shells, you can check the version with the command `python --version`. Similarly, your system may have a `python3` command, whose version can be checked with `python3 --version`.
13+
14+
### postgresql
15+
If postgresql is present, the command `postgres --version` will yield the version number; otherwise the command will fail. The `electiondata` package has been tested with postgres version 13, but probably any reasonably recent version will do. If `postgresql` is not present, you should be able to install it with any reasonable package manager. (On macOS with package manager `homebrew`, use the command `brew install postgresql`) The default values you will need to connect to your `postgresql` instance are:
16+
* host: `localhost`
17+
* port: `5432`
18+
* user: `postgres`
19+
* password: (leave the password blank)
20+
21+
### python packages
22+
To install the required packages, run `python3.9 -m pip install -r requirements.txt` from the [root folder of the repository](../). Because some of the required packages have requirements of their own, which may or may not be installed already, your system prompt you to install some other packages. If so, install the suggested packages and try `python3.9 -m pip install -r requirements.txt` again.
23+
24+
## Installation
25+
From the [root folder of the repository](../) run `python3.9 setup.py install`. (You may be able to use `python setup.py install` or `python3 setup.py install` instead, if those point to `python3.9`, as described above.)

0 commit comments

Comments
 (0)