• Stars
    star
    255
  • Rank 154,381 (Top 4 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created about 7 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

SPAtial GrapHs: nETworks, Topology, & Inference

pysal/spaghetti

SPAtial GrapHs: nETworks, Topology, & Inference

Spaghetti is an open-source Python library for the analysis of network-based spatial data. Originating from the network module in PySAL (Python Spatial Analysis Library), it is under active development for the inclusion of newly proposed methods for building graph-theoretic networks and the analysis of network events.

An example of a network's minimum spanning tree:

PyPI version Conda Version tag Binder
Downloads Conda Downloads Documentation Gitter
Pypi python versions Conda Recipe codecov Code style: black
Continuous Integration status DOI License

Examples

The following are a selection of some examples that can be launched individually as interactive binders from the links on their respective pages. Additional examples can be found in the Tutorials section of the documentation. See the pysal/notebooks project for a jupyter-book version of this repository.

Installation

Python 3.8, 3.9, 3.10, and 3.11 are tested for support by spaghetti. Please make sure that you are operating in a Python >= 3.8 environment.

Installing with conda via conda-forge (highly recommended)

To install spaghetti and all its dependencies, we recommend using the conda manager, specifically with the conda-forge channel. This can be obtained by installing the Anaconda Distribution (a free Python distribution for data science), or through miniconda (minimal distribution only containing Python and the conda package manager).

Using conda, spaghetti can be installed as follows:

$ conda config --set channel_priority strict
$ conda install --channel conda-forge spaghetti

Also, geopandas provides a nice example to create a fresh environment for working with spatial data.

Installing with PyPI

$ pip install spaghetti

or download the source distribution (.tar.gz) and decompress it to your selected destination. Open a command shell and navigate to the decompressed folder.

$ pip install .

Warning

When installing via pip, you have to ensure that the required dependencies for spaghetti are installed on your operating system. Details on how to install these packages are linked below. Using conda (above) avoids having to install the dependencies separately.

Install the most current development version of spaghetti by running:

$ pip install git+https://github.com/pysal/spaghetti

Requirements

Soft Dependencies

History

spaghetti was created and has evolved in line with the Python Spatial Analysis Library ecosystem for the specific purpose of utilizing the functionality of spatial weights in libpysal for generating network segment contiguity objects. The PySAL project was started in the mid-2000s when installation was difficult to maintain. Due to the non-triviality of relying on dependencies to secondary packages, a conscious decision was made to limit dependencies and build native PySAL data structures in cases where at all possible. Therefore, the original pysal.network submodule was developed to address the need for integrating support for network data structures with PySAL weights data structures, with the target audience being spatial data scientists and anyone interested in investigating network-centric phenomena within PySAL. Owing to the co-development of network functionality found within spaghetti and the evolution of the wider PySAL ecosystem, today, the package provides specialized network functionality that easily integrates with the rest of PySAL. This allows users of spaghetti’s network functionality to access spatial analysis functionality that complements network analysis, such as spatial statistical tools with esda and integration with core components of libpysal: libpysal.weights (mentioned above), libpysal.cg (computational geometry and data structures), libpysal.io (input-output), and libpysal.examples (built-in example data).

Contribute

PySAL-spaghetti is under active development and contributors are welcome.

If you have any suggestions, feature requests, or bug reports, please open new issues on GitHub. To submit patches, please review PySAL's documentation for developers, the PySAL development guidelines, the spaghetti contributing guidelines before opening a pull request. Once your changes get merged, you’ll automatically be added to the Contributors List.

Support

If you are having issues, please create an issue, start a discussion, or talk to us in the gitter room. All questions, comments, & discussions should happen in a public forum, where possible. Private messages and emails will not be answered in a substantive manner.

Code of Conduct

As a PySAL-federated project, spaghetti follows the Code of Conduct under the PySAL governance model.

License

The project is licensed under the BSD 3-Clause license.

BibTeX Citation

If you use PySAL-spaghetti in a scientific publication, we would appreciate using the following citations:

@article{Gaboardi2021,
    doi       = {10.21105/joss.02826},
    url       = {https://doi.org/10.21105/joss.02826},
    year      = {2021},
    publisher = {The Open Journal},
    volume    = {6},
    number    = {62},
    pages     = {2826},
    author    = {James D. Gaboardi and Sergio Rey and Stefanie Lumnitz},
    title     = {spaghetti: spatial network analysis in PySAL},
    journal   = {Journal of Open Source Software}
}

@misc{Gaboardi2018,
    author    = {Gaboardi, James D. and Laura, Jay and Rey, Sergio and 
                 Wolf, Levi John and Folch, David C. and Kang, Wei and 
                 Stephens, Philip and Schmidt, Charles},
    month     = {oct},
    year      = {2018},
    title     = {pysal/spaghetti},
    url       = {https://github.com/pysal/spaghetti},
    doi       = {10.5281/zenodo.1343650},
    keywords  = {graph-theory,network-analysis,python,spatial-networks,topology}
}

Citing Work

Funding

This project is/was partially funded through:

Atlanta Research Data Center: A Polygon-Based Approach to Spatial Network Allocation

National Science Foundation Award #1825768: National Historical Geographic Information System

More Repositories

1

pysal

PySAL: Python Spatial Analysis Library Meta-Package
Jupyter Notebook
1,264
star
2

momepy

Urban Morphology Measuring Toolkit
Python
450
star
3

mgwr

Multiscale Geographically Weighted Regression (MGWR)
Jupyter Notebook
332
star
4

spopt

Spatial Optimization
Python
248
star
5

libpysal

Core components of Python Spatial Analysis Library
Python
239
star
6

esda

statistics and classes for exploratory spatial data analysis
Jupyter Notebook
201
star
7

tobler

Spatial interpolation, Dasymetric Mapping, & Change of Support
Jupyter Notebook
142
star
8

mapclassify

Classification schemes for choropleth mapping.
Jupyter Notebook
128
star
9

segregation

Segregation Measurement, Inferential Statistics, and Decomposition Analysis
Jupyter Notebook
106
star
10

splot

Lightweight plotting for geospatial analysis in PySAL
Jupyter Notebook
97
star
11

scipy2019-intermediate-gds

This is the Intermediate Data Science Workshop for the 2019 Scientific Python conference in Austin, TX.
Jupyter Notebook
76
star
12

pointpats

Planar Point Pattern Analysis in PySAL
Jupyter Notebook
76
star
13

giddy

Exploratory spatiotemporal data analysis and Geospatial distribution dynamics analysis
Jupyter Notebook
72
star
14

geopyter

GeoPyTeR: Geographical Python Teaching Resource
Jupyter Notebook
68
star
15

spreg

Spatial econometric regression in Python
Python
54
star
16

notebooks

jupyter/ipython notebooks demonstrating PySAL functionality
Python
53
star
17

legendgram

Legendgrams are distributional visualizations for map classification schemes
Python
48
star
18

spint

SPatial INTeraction Models (spint)
Jupyter Notebook
46
star
19

spglm

SParse Generalized Linear Models (spglm)
Python
29
star
20

inequality

Measures of spatial (and non-spatial) inequality
Jupyter Notebook
21
star
21

access

Classical and novel measures of spatial accessibility to services
Jupyter Notebook
21
star
22

gwr

This is a repository for the geographically-weighted regression submodule of the Python Spatial Analysis Library
Jupyter Notebook
16
star
23

spvcm

multilevel spatially-correlated variance components models
Jupyter Notebook
14
star
24

region

A library for Spatially-Explicit Regionalization
Python
14
star
25

pysal.github.io

Landing Page for pysal.
HTML
8
star
26

pysalREST

This repository contains an automated Python library extraction tool originally developed to expose the PySAL library as a RESTful service.
Python
7
star
27

pPysal

Parallel PySAL
Python
4
star
28

governance

PySAL Governance
4
star
29

pysal-sprint-2020-10

Organization of PySAL Sprint for 2020-10-24/25
3
star
30

pysal_examples

Example data sets for PySAL
HTML
3
star
31

submodule_template

This provides a template for submodules to use in the PySAL project
Jupyter Notebook
2
star
32

logo

Jupyter Notebook
1
star
33

docker

Docker containers of PySAL Projects
Dockerfile
1
star