Skip to main content

Analysis of Network-constrained Spatial Data

Project description

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, and 3.10 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spaghetti-1.6.8.tar.gz (75.8 kB view details)

Uploaded Source

Built Distribution

spaghetti-1.6.8-py3-none-any.whl (46.2 kB view details)

Uploaded Python 3

File details

Details for the file spaghetti-1.6.8.tar.gz.

File metadata

  • Download URL: spaghetti-1.6.8.tar.gz
  • Upload date:
  • Size: 75.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for spaghetti-1.6.8.tar.gz
Algorithm Hash digest
SHA256 cdaa4b14841fe8a954a8810b498857ec14b20d0fcf67456138ef3e12edeb2b5c
MD5 9b7dbc2d93eef45911cc8a58c95209ac
BLAKE2b-256 9017c120b59ce9846df088b445220be3c11f6cccae220d24c762c6248dcf365a

See more details on using hashes here.

Provenance

File details

Details for the file spaghetti-1.6.8-py3-none-any.whl.

File metadata

  • Download URL: spaghetti-1.6.8-py3-none-any.whl
  • Upload date:
  • Size: 46.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for spaghetti-1.6.8-py3-none-any.whl
Algorithm Hash digest
SHA256 6e0c30f1e0d663ae3b8b8c6d739152423e2ad4df0e0e17a3ad53b6ea22cc0e0a
MD5 91a6c903a8029cff45781f6fcc12b05f
BLAKE2b-256 35aa2d9118265b98d98b8a0078ee84cc68422388bc6c2cb264591ae93167785c

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page