Installation¶
segregation requires Python >= 3.12.
pipdirectly running in the prompt:pip install segregation
Using the
conda-forgechannel as described in https://github.com/conda-forge/segregation-feedstock:conda install -c conda-forge segregation
Install the development version from a local clone of this repository (this is an editable install):
git clone https://github.com/pysal/segregation.git cd segregation pip install -e .
To use the bundled conda environment for the development install, create it first and then install into it:
conda env create -f environment.yml conda activate segregation pip install -e .
pipdirectly from this repository running in the prompt:pip install git+https://github.com/pysal/segregation
Optional dependencies¶
The core installation covers every segregation index and the inference, decomposition, batch, and multiscalar tools. A few features and the example notebooks rely on extra packages that are not installed automatically:
Package |
Needed for |
Install |
|---|---|---|
|
the network example notebooks |
|
|
the |
|
|
downloading the prepackaged OpenStreetMap street networks used in the network examples and tests |
|
|
the |
|
|
progress bars ( |
|
All five are bundled in the tests extra:
pip install "segregation[tests]"
or, with conda:
conda install -c conda-forge pandana pandarm quilt3 watermark ipywidgets
Building the documentation¶
The example notebooks are executed when the documentation is built, so building the docs also runs every notebook:
conda env create -f environment.yml
conda activate segregation
pip install -e .
cd docs
make html
To execute the notebooks on their own:
jupyter nbconvert --execute --to notebook --inplace docs/notebooks/*.ipynb