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
unittests 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

As of version 1.6.0, spaghetti officially supports Python 3.7, 3.8, and 3.9. Please make sure that you are operating in a Python >= 3.7 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.

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.4.tar.gz (75.7 kB view details)

Uploaded Source

Built Distribution

spaghetti-1.6.4-py3-none-any.whl (46.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: spaghetti-1.6.4.tar.gz
  • Upload date:
  • Size: 75.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for spaghetti-1.6.4.tar.gz
Algorithm Hash digest
SHA256 f8c139d776a487b4b183db910a5d11d3142aca872e850303438c7b150f4d37f0
MD5 a900f12e7c9f2a24c12abf7681f83e7b
BLAKE2b-256 ef1f5730631bb85debf3feb243ebf65baa482b19e50bdade3d1dcd4184a6742f

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: spaghetti-1.6.4-py3-none-any.whl
  • Upload date:
  • Size: 46.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for spaghetti-1.6.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e2eb20806e0c2e35228032885de17e7aef39f512dbee67e1fdb1a87e4c9b265a
MD5 cb261424c3766b3fa0a0df490c21c858
BLAKE2b-256 7e77a2d567998052df6edaca4a447a461a52b07800ce34fe6c6354eabb2f22a1

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