Skip to content

Commit 5145c34

Browse files
Merge pull request #695 from ElectionDataAnalysis/issue630-othertype
Issue630 othertype
2 parents 29c57bf + 0d25f1c commit 5145c34

788 files changed

Lines changed: 7486 additions & 14485 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.

MANIFEST.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
graft src/election_data_analysis/juris_and_munger
2-
graft src/election_data_analysis/CDF_schema_def_info
1+
graft src/electiondata/juris_and_munger
2+
graft src/electiondata/CDF_schema_def_info

docs/User_Guide.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ It's easiest to use the JurisdictionPrepper() object to create or update jurisdi
203203

204204
(1) From the directory containing `jurisdiction_prep.ini`, open a python interpreter. Import the package and initialize a JurisdictionPrepper(), e.g.:
205205
```
206-
>>> import election_data_analysis as ea
206+
>>> import elections as ea
207207
>>> jp = ea.JurisdictionPrepper()
208208
```
209209
(2) Call new_juris_files(), which will create the necessary files in the jurisdiction directory, as well as a starter dictionary file (`XX_starter_dictionary.txt`) in the current directory.
@@ -225,7 +225,7 @@ Texas;Harrison County county
225225
```
226226
Counties must be added by hand.
227227

228-
NB: in some jurisdictions, the major subdivision type is not 'county. For instance, Louisiana's major subdivisions are called 'parish'. In the `election_data_analysis.analyze` module, several routines roll up results to the major subdivision -- usually counties. The ReportingUnitType of the major subdivision is read from the file `src/jurisdictions/000_major_subjurisdiction_types.txt` if possible; if that file is missing, or does not provide a subdivision type for the particular jurisdiction in question, the system will try to deduce the major subdivision type from the database.
228+
NB: in some jurisdictions, the major subdivision type is not 'county. For instance, Louisiana's major subdivisions are called 'parish'. In the `elections.analyze` module, several routines roll up results to the major subdivision -- usually counties. The ReportingUnitType of the major subdivision is read from the file `src/jurisdictions/000_major_subjurisdiction_types.txt` if possible; if that file is missing, or does not provide a subdivision type for the particular jurisdiction in question, the system will try to deduce the major subdivision type from the database.
229229

230230
The system assumes that internal database names of ReportingUnits carry information about the nesting of the basic ReportingUnits (e.g., counties, towns, wards, etc., but not congressional districts) via semicolons. For example: `
231231
* `Pennsylvania;Philadelphia;Ward 8;Division 6` is a precinct in
@@ -385,7 +385,7 @@ There are routines in the `JurisdictionPrepper()` class to help prepare a jurisd
385385
* `add_elements_from_multi_results_file(directory)` does the same for every file/munger in the directory named in a `.ini` file in the directory
386386

387387
## Load Data
388-
Each results file to be loaded must be designated in a `*.ini` file inside the corresponding jurisdiction's subfolder of `ini_files_for_results` in the repository. The `*.ini` files currrently in this repository correspond to data files available from the [TestingData repository](https://github.com/ElectionDataAnalysis/TestingData). These should load directly with the munger and jurisdiction files from the election_data_analysis repository.
388+
Each results file to be loaded must be designated in a `*.ini` file inside the corresponding jurisdiction's subfolder of `ini_files_for_results` in the repository. The `*.ini` files currrently in this repository correspond to data files available from the [TestingData repository](https://github.com/ElectionDataAnalysis/TestingData). These should load directly with the munger and jurisdiction files from the elections repository.
389389

390390
If all the `.ini` files in a single directory will use the same munger, jurisdiction and election, you can use `make_ini_file_batch` to create these `.ini` files in batches. For example,
391391
```
@@ -405,7 +405,7 @@ The DataLoader class allows batch uploading of all data in a given directory. Th
405405
The `load_all()` method will read each `.ini` file and make the corresponding upload.
406406
From a directory containing a `run_time.ini` parameter file, run
407407
```
408-
import election_data_analysis as ea
408+
import elections as ea
409409
dl = ea.DataLoader()
410410
dl.load_all()
411411
```
@@ -424,7 +424,7 @@ If there are no errors, the results files will be moved to a subdirectory of the
424424
## Pull Data
425425
The Analyzer class uses parameters in the file `run_time.ini`, which should be in the directory from which you are running the program. This class has a number of functions that allow you to aggregate the data for analysis purposes. For example, running the `.top_counts()` function exports files into your rollup_dataframe directory which with counts summed up at a particular reporting unit level. This function expects 4 arguments: the election, the jurisdiction, the reporting unit level at which the aggregation will occur, and a boolean variable indicating whether you would like the data aggregated by vote count type. For example:
426426
```
427-
from election_data_analysis import Analyzer
427+
from elections import Analyzer
428428
analyzer = Analyzer()
429429
analyzer.top_counts('2018 General', 'North Carolina', 'county', True)
430430
```
@@ -522,7 +522,7 @@ Some xml files (e.g., Ohio 2020 General) use the older Version 1 common data for
522522

523523
This package also provides functionality to export the data to xml according to the [NIST election results reporting schema (Version 2)](https://github.com/usnistgov/ElectionResultsReporting/raw/version2/NIST_V2_election_results_reporting.xsd). This is as simple as identifying an election and jurisdiction of interest:
524524
```
525-
from election_data_analysis import Analyzer
525+
from elections import Analyzer
526526
analyzer = Analyzer()
527527
election_report = analyzer.export_nist_v2("2020 General", "Georgia")
528528
```

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
from setuptools import setup, find_packages
22

33
setup(
4-
name="election_data_analysis",
4+
name="electiondata",
55
version="2.0",
66
package_dir={"": "src"},
77
packages=find_packages(where="src"),
88
include_package_data=True,
9-
url="https://github.com/sfsinger19103/results_analysis",
10-
author="Stephanie Singer",
9+
url="https://github.com/ElectionDataAnalysis/election_data_analysis",
10+
author="Stephanie Frank Singer, et al.",
1111
author_email="sfsinger@campaignscientific.com",
1212
install_requires=["sqlalchemy", "pandas"],
1313
)

0 commit comments

Comments
 (0)