Skip to content

Commit 2596f88

Browse files
Merge pull request #721 from ElectionDataAnalysis/feature-version-2.0
Feature version 2.0
2 parents 5145c34 + ab42b28 commit 2596f88

619 files changed

Lines changed: 100225 additions & 27927 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.

docs/About_the_Code.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,25 @@ The information in this directory determines the structure of the database creat
1818

1919
### Conventions
2020
* Some jurisdiction names (e.g., "District of Columbia") contain spaces, while it is inconvenient to use spaces in directory and file names. So we distinguish between a jurisdiction's "true name" and its "system name", which replaces all spaces by hyphens (e.g., "District-of-Columbia").
21+
22+
23+
### Testing
24+
There are `pytest` routines to test the dataloading, analyzer and jurisdiction-prepping functions. The data required to test the latter two is in the [`000_data_for_pytest`](../tests/000_data_for_pytest) folder. These depend on a file `tests/run_time.ini`. Note that the run_time.ini file is *not* part of the repository, as it contains database connection information. You will need to create it yourself. Or you can point to a different parameter file with the custom option `--param_file` for pytest.
25+
26+
The [dataloader test](../tests/dataloading_tests/test_dataloading.py) depends on information outside the [tests folder] (../tests):
27+
- election results files in the results directory specified in by the `results_dir` parameter in `dataloading_tests/run_time.ini`.
28+
- if the results directory does not exist, the test will create it and pull files from [`https://github.com/ElectionDataAnalysis/TestingData.git`](https://github.com/ElectionDataAnalysis/TestingData.git). You can specify a different url with the custom pytest option `--test_data_url`
29+
- reference files in the [`reference_results` folder](../src/reference_results). By convention, these are tabs-separated and named for the jurisdiction, e.g., `Virgina.tsv` or `American-Samoa.tsv`. Note the hyphens. If there are no reference results for a given election-jurisdiction pair, the test will fail. The reference files must have columns `Jurisdiction,Election,Contest,ReportingUnit,VoteType,Count`.
30+
31+
Note that the `analyzer_tests` and `dataloader_tests` directories each have a `conftest.py` file. This may cause a problem if you try to run them simultaneously via `pytest` from the `test` directory. Running them separately works:
32+
```
33+
tests % pytest analyzer_tests
34+
tests % pytest dataloader_tests
35+
```
36+
37+
38+
39+
2140

2241

2342

docs/User_Guide.md

Lines changed: 106 additions & 121 deletions
Large diffs are not rendered by default.

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
matplotlib==3.1.2
22
numpy==1.18.1
3-
pandas==1.1.0
3+
pandas==1.3.2
44
psycopg2==2.8.6
55
scipy==1.6.3
66
SQLAlchemy==1.3.12

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
package_dir={"": "src"},
77
packages=find_packages(where="src"),
88
include_package_data=True,
9-
url="https://github.com/ElectionDataAnalysis/election_data_analysis",
9+
url="https://github.com/ElectionDataAnalysis/electiondata",
1010
author="Stephanie Frank Singer, et al.",
1111
author_email="sfsinger@campaignscientific.com",
1212
install_requires=["sqlalchemy", "pandas"],

src/electiondata/CDF_schema_def_info/elements/BallotMeasureContest/enumerations.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/electiondata/CDF_schema_def_info/elements/BallotMeasureSelection/enumerations.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/electiondata/CDF_schema_def_info/elements/Candidate/enumerations.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/electiondata/CDF_schema_def_info/elements/CandidateContest/enumerations.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/electiondata/CDF_schema_def_info/elements/CandidateSelection/enumerations.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/electiondata/CDF_schema_def_info/elements/Contest/enumerations.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)