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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for spaghetti-1.6.6.tar.gz
Algorithm Hash digest
SHA256 2b278cf30f52e2c03c65a2954f4da1f286989ab7c103800673605fb5c626688c
MD5 edd22bc7b805a61e07ced26752e4ef95
BLAKE2b-256 68685d9e4b2bcd29b60106dcd525dbe28016277cad7deae3e494e6eb10b72ab9

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for spaghetti-1.6.6-py3-none-any.whl
Algorithm Hash digest
SHA256 b63bde155a300a90059d05679e97f69947930a32758f0fee6fe68b164bb21410
MD5 fef5680fd3a5aa4e2b71f15f0ae05cf6
BLAKE2b-256 c2017107cbb2fe2d00acdbfb31ec77a2fd7af2a59a80cb1e4aa1847fd8622185

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