1-
21# gerrytools
32
4- [ ![ CircleCI] ( https://dl.circleci.com/status-badge/img/gh/mggg/gerrytools/tree/main.svg?style=svg )] ( https://dl.circleci.com/status-badge/redirect/gh/mggg/gerrytools/tree/main )
5- [ ![ codecov] ( https://codecov.io/gh/mggg/gerrytools/branch/main/graph/badge.svg?token=O09GYF7C9X )] ( https://codecov.io/gh/mggg/gerrytools )
6- [ ![ PyPI version] ( https://badge.fury.io/py/gerrytools.svg )] ( https://badge.fury.io/py/gerrytools )
7- [ ![ docs] ( https://img.shields.io/badge/%E2%93%98-Documentation-%230099cd )] ( https://mggg.github.io/gerrytools/ )
8- [ ![ website] ( https://img.shields.io/badge/%F0%9F%8C%90%20-MGGG%20Redistricting%20Lab-%230099cd )] ( https://mggg.org )
9- [ ![ Code style: black] ( https://img.shields.io/badge/code%20style-black-000000.svg )] ( https://github.com/psf/black )
3+ [ ![ CircleCI] ( https://dl.circleci.com/status-badge/img/gh/mggg/gerrytools/tree/main.svg?style=svg )] ( https://dl.circleci.com/status-badge/redirect/gh/mggg/gerrytools/tree/main )
4+ [ ![ codecov] ( https://codecov.io/gh/mggg/gerrytools/branch/main/graph/badge.svg?token=O09GYF7C9X )] ( https://codecov.io/gh/mggg/gerrytools )
5+ [ ![ PyPI version] ( https://badge.fury.io/py/gerrytools.svg )] ( https://badge.fury.io/py/gerrytools )
6+ [ ![ docs] ( https://img.shields.io/badge/%E2%93%98-Documentation-%230099cd )] ( https://mggg.github.io/gerrytools/ )
7+ [ ![ website] ( https://img.shields.io/badge/%F0%9F%8C%90%20-MGGG%20Redistricting%20Lab-%230099cd )] ( https://mggg.org )
8+ [ ![ Code style: black] ( https://img.shields.io/badge/code%20style-black-000000.svg )] ( https://github.com/psf/black )
109[ ![ Imports: isort] ( https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336 )] ( https://pycqa.github.io/isort/ )
1110
12-
13- A companion to [ GerryChain] ( https://github.com/mggg/GerryChain ) , GerryTools is
14- a robust suite of geometric and algorithmic tools to analyze districting plans
15- and related data. GerryTools is actively developed and used by the
16- [ MGGG Redistricting Lab] ( https://mggg.org ) and our collaborators to prepare
17- accurate, precise, and clean information for our projects. It is distributed
18- under a [ 3-Clause BSD License] ( https://opensource.org/licenses/BSD-3-Clause ) .
19-
11+ A companion to [ GerryChain] ( https://github.com/mggg/GerryChain ) , GerryTools is a robust suite of
12+ geometric and algorithmic tools to analyze districting plans and related data. GerryTools is
13+ actively developed and used by the [ MGGG Redistricting Lab] ( https://mggg.org ) and our collaborators
14+ to prepare accurate, precise, and clean information for our projects. It is distributed under a
15+ [ 3-Clause BSD License] ( https://opensource.org/licenses/BSD-3-Clause ) .
2016
2117## Installation
2218
23- > :warning : WARNING: The latest release of this package requires that the user
24- > have Rust installed on their computer. This is due to a bug in one of the
25- > dependencies of GerryTools and only appears for users running Python version
26- > 3.12. If you are on Linux or MacOS, then please run the command
27- > ```
28- > curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
29- > ```
30- > from your terminal. If you are on Windows, download and run the exe file
31- > at [this link](https://rust-lang.org/tools/install) This Warning will
32- > be removed when the bug is patched.
33-
3419### Using ` pip ` (recommended)
3520
3621To install GerryTools from [ PyPi] ( https://pypi.org/project/gerrytools/ ) , run
@@ -39,61 +24,57 @@ To install GerryTools from [PyPi](https://pypi.org/project/gerrytools/), run
3924pip install gerrytools
4025```
4126
42- from the command line. if you would like to use the ` mgrp ` and ` ben ` modules as well,
43- you can invoke
27+ from the command line. if you would like to use the ` mgrp ` and ` ben ` modules as well, you can invoke
4428
4529``` console
46- pip install gerrytools[mgrp]
30+ pip install " gerrytools[mgrp]"
4731```
4832
49- you will need to make sure that [ Docker Desktop] ( https://www.docker.com/get-started/ )
50- is installed on your machine an updated to version >= 4.28.0. For more information on
51- getting this set up, please see
52- [ our documentation page] ( https://gerrytools.readthedocs.io/en/latest/topics/docker/ )
33+ you will need to make sure that [ Docker Desktop] ( https://www.docker.com/get-started/ ) is installed
34+ on your machine an updated to version >= 4.28.0. For more information on getting this set up, please
35+ see [ our documentation page] ( https://gerrytools.readthedocs.io/en/latest/topics/docker/ )
5336
5437## Usage
5538
56- GerryTools is split up into multiple sub-packages, each designed to simplify and
57- standardize redistricting workflows.
58-
59- * ** ` gerrytools.ben ` ** BEN (binary-ensemble) is our general purpose compression
60- algorithm for working with ensembles of plans. In general, the ben algorithm can
61- improve the storage of an ensemble of plans by an order of magnitude. When combined
62- with the special XBEN (eXtreme BEN) portion of the algorithm, many ensembles of
63- plans can be compressed small enough to fit into an email (~ 25Mb).
64-
65- * ** ` gerrytools.data ` ** deals with the retrieval and processing of data. Here, you can
66- find tools for grabbing decennial Census ('10 and '20), ACS 5-year ('12-'20), ACS CVAP
67- Special Tab ('12-'20), districtr portal, and 2020 decennial Census geometric data. You
68- can also find tools for moving CVAP data to other levels of geometry (e.g. prorating
69- 2019 CVAP on 2019 Census tracts to 2020 blocks).
70-
71- * ** ` gerrytools.geometry ` ** provides facilities for dealing with geometric and related
72- data. There are tools for translating and evaluating GerryChain
73- [ ` Partition ` ] ( https://mggg.github.io/GerryChain/api.html#module-gerrychain.partition ) s,
74- performing fast geometric dissolutions, creating unit maps (e.g. 2020 blocks to
75- 2020 VTDs), creating
76- [ dual graphs for GerryChain] ( https://mggg.github.io/GerryChain/api.html#adjacency-graphs ) ,
77- and optimization algorithms for renaming districts.
78-
79- * ** ` gerrytools.mgrp ` ** this module uses a Docker container to allow users to access several
80- ensemble methods for generating districting plans on a state. In particular our Rust
81- implementation of our ` gerrychain ` library, ` frcw ` , the Julia implementation of
82- [ Forest Recom] ( https://arxiv.org/pdf/2008.08054.pdf ) , and the R/C++ implementation of
83- [ Sequential Monte Carlo (SMC)] ( https://github.com/alarm-redist/redist ) are available
84- through this module.
85-
86- * ** ` gerrytools.plotting ` ** contains methods for generating extremely
87- high-quality Lab-standard data visualizations.
88-
89- * ** ` gerrytools.scoring ` ** provides a vast array of redistricting plan scores.
90- These can be used standalone _ or_ as GerryChain
91- [ updaters] ( https://mggg.github.io/GerryChain/api.html#module-gerrychain.updaters ) .
92-
93- * ** ` gerrychain.utilities ` ** has ease-of-use methods for renaming
94- directories containing shapefiles (which comes in handy more often than you'd
95- think) and making JSON objects out of Python objects (useful when trying to
96- organize information for many districting plans in a standard format).
39+ GerryTools is split up into multiple sub-packages, each designed to simplify and standardize
40+ redistricting workflows.
41+
42+ - ** ` gerrytools.ben ` ** BEN (binary-ensemble) is our general purpose compression algorithm for
43+ working with ensembles of plans. In general, the ben algorithm can improve the storage of an
44+ ensemble of plans by an order of magnitude. When combined with the special XBEN (eXtreme BEN)
45+ portion of the algorithm, many ensembles of plans can be compressed small enough to fit into an
46+ email (~ 25Mb).
47+
48+ - ** ` gerrytools.data ` ** deals with the retrieval and processing of data. Here, you can find tools
49+ for grabbing decennial Census ('10 and '20), ACS 5-year ('12-'20), ACS CVAP Special Tab ('12-'20),
50+ districtr portal, and 2020 decennial Census geometric data. You can also find tools for moving
51+ CVAP data to other levels of geometry (e.g. prorating 2019 CVAP on 2019 Census tracts to 2020
52+ blocks).
53+
54+ - ** ` gerrytools.geometry ` ** provides facilities for dealing with geometric and related data. There
55+ are tools for translating and evaluating GerryChain
56+ [ ` Partition ` ] ( https://mggg.github.io/GerryChain/api.html#module-gerrychain.partition ) s, performing
57+ fast geometric dissolutions, creating unit maps (e.g. 2020 blocks to 2020 VTDs), creating
58+ [ dual graphs for GerryChain] ( https://mggg.github.io/GerryChain/api.html#adjacency-graphs ) , and
59+ optimization algorithms for renaming districts.
60+
61+ - ** ` gerrytools.mgrp ` ** this module uses a Docker container to allow users to access several
62+ ensemble methods for generating districting plans on a state. In particular our Rust
63+ implementation of our ` gerrychain ` library, ` frcw ` , the Julia implementation of
64+ [ Forest Recom] ( https://arxiv.org/pdf/2008.08054.pdf ) , and the R/C++ implementation of
65+ [ Sequential Monte Carlo (SMC)] ( https://github.com/alarm-redist/redist ) are available through this
66+ module.
67+
68+ - ** ` gerrytools.plotting ` ** contains methods for generating extremely high-quality Lab-standard data
69+ visualizations.
70+
71+ - ** ` gerrytools.scoring ` ** provides a vast array of redistricting plan scores. These can be used
72+ standalone _ or_ as GerryChain
73+ [ updaters] ( https://mggg.github.io/GerryChain/api.html#module-gerrychain.updaters ) .
74+
75+ - ** ` gerrychain.utilities ` ** has ease-of-use methods for renaming directories containing shapefiles
76+ (which comes in handy more often than you'd think) and making JSON objects out of Python objects
77+ (useful when trying to organize information for many districting plans in a standard format).
9778
9879<!-- ### Example
9980
@@ -142,23 +123,25 @@ minute. -->
142123
143124## Contributing
144125
145- GerryTools is an active project, and has multiple contributors. If you'd like to
146- contribute, here are a few house rules:
126+ GerryTools is an active project, and has multiple contributors. If you'd like to contribute, here
127+ are a few house rules:
147128
148- 1 . After cloning this repository, run ` sh setup.sh ` to download and install
149- necessary git hooks and linting configurations.
129+ 1 . After cloning this repository, run ` sh setup.sh ` to download and install necessary git hooks and
130+ linting configurations.
150131
151- 2 . ** Follow the [ PEP8 style guide] ( https://peps.python.org/pep-0008/ ) ** . After
152- installing the above git hooks, linting is performed before every push. PEP8 errors can be automatically corrected by running ` autopep8 --in-place --aggressive -r gerrytools ` on the command line from the root directory.
132+ 1 . ** Follow the [ PEP8 style guide] ( https://peps.python.org/pep-0008/ ) ** . After installing the above
133+ git hooks, linting is performed before every push. PEP8 errors can be automatically corrected by
134+ running ` autopep8 --in-place --aggressive -r gerrytools ` on the command line from the root
135+ directory.
153136
154- 3 . ** Write tests.** All changes, major or minor, ** must** be accompanied by testing
155- code. Code and tests will be immediately reviewed by Lab maintainers.
137+ 1 . ** Write tests.** All changes, major or minor, ** must** be accompanied by testing code. Code and
138+ tests will be immediately reviewed by Lab maintainers.
156139
157- 4 . Test coverage must stay ** at least** the same; this can be checked by running
158- ` pytest --cov=evaltools ` after the tests are added to ` tests/ ` .
140+ 1 . Test coverage must stay ** at least** the same; this can be checked by running
141+ ` pytest --cov=evaltools ` after the tests are added to ` tests/ ` .
159142
160- 5 . ** Write documentation.** All changes should be documented via docstrings,
161- and code should be repletely commented. It's much easier to decipher commented
162- code! Docstring documentation is compiled on every commit via git hooks.
143+ 1 . ** Write documentation.** All changes should be documented via docstrings, and code should be
144+ repletely commented. It's much easier to decipher commented code! Docstring documentation is
145+ compiled on every commit via git hooks.
163146
164147We look forward to your contributions!
0 commit comments