Skip to content

matt-mohn/mosaic_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mosaic

Redistricting for Python


Mosaic is a redistricting toolkit using recombination (ReCom) algorithms with simulated annealing. It includes a live GUI for map visualization and optimization.

Quick Start

Option 1: Run the launcher (no Python required)

  1. Download the project: Click the green Code button at the top of this page, then select Download ZIP
  2. Extract the ZIP: Right-click the downloaded file and choose "Extract All"
  3. Run the launcher:
    • Windows: Double-click run_mosaic.bat
    • Mac/Linux: Open a terminal in the folder and run chmod +x run_mosaic.sh && ./run_mosaic.sh

The launcher auto-installs dependencies on first run (requires internet).

Option 2: Install with pip

pip install -e .
mosaic

Requirements

  • Python >= 3.10
  • Windows 10+ / macOS 12+ / Linux

Sample Data

The shapefiles/ folder includes North Carolina precinct data as a ready-to-use starting point.

Background

This is a Python port of Mosaic for R. Some features are implemented differently or still in progress.

License

MIT License - see LICENSE


A project of Matt Mohn (@mattmxhn). The ReCom algorithm is derived from the one developed by the MGGG Redistricting Lab.

About

MosaicPy Demo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages