Skip to main content

A Rust-powered toolkit for building visibility graphs from time series.

Project description

vgraph-forge

This project provides a Rust-powered library for creating and manipulating visibility graphs, with first-class Python bindings generated via PyO3 and maturin. It currently implements both the Natural Visibility Graph (NVG) and the Horizontal Visibility Graph (HVG), exposing the same data structures to Rust and Python callers.

Features

  • Efficient storage for visibility graphs, including helper methods to inspect vertices and edges.
  • Natural and horizontal visibility graph builders for scalar time-series data.
  • Optional adjacency filtering and subgraph extraction utilities.
  • Easy integration with Python via a compiled extension module.

Installation

Once published on PyPI, the package can be installed with pip:

pip install vgraph-forge

During development (or before publishing), build a local wheel with maturin build --release and install the resulting artifact from target/wheels/ in your downstream project via pip install <wheel>. Only contributors building from source need Rust and maturin; consumers installing the wheel do not.

Usage

Below is a compact Python example that constructs both NVG and HVG representations from a simple time series:

from vgraph_forge import (
	build_visibility_graph,
	build_horizontal_visibility_graph,
)

series = [1.0, 3.2, 2.5, 4.0, 1.7]

# Natural visibility graph (NVG)
nvg = build_visibility_graph(series)
print("NVG vertices:", nvg.vertices)
print("NVG edges:", nvg.edges)

# Horizontal visibility graph (HVG) with adjacent-edge filtering
hvg = build_horizontal_visibility_graph(series, skip_adjacent=True)
print("HVG edges (skip adjacent):", hvg.edges)

print("NVG edge count:", nvg.edge_count())
print("HVG node count:", hvg.node_count())

See examples/python/plot_visibility_graph.py for a Matplotlib visualization helper and examples/python/visibility_from_csv.py for a CSV-to-edge-list CLI.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

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

vgraph_forge-0.1.2.tar.gz (16.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

vgraph_forge-0.1.2-cp39-abi3-win_amd64.whl (146.6 kB view details)

Uploaded CPython 3.9+Windows x86-64

vgraph_forge-0.1.2-cp39-abi3-manylinux_2_34_x86_64.whl (291.9 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.34+ x86-64

vgraph_forge-0.1.2-cp39-abi3-macosx_11_0_arm64.whl (251.3 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

vgraph_forge-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl (260.3 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file vgraph_forge-0.1.2.tar.gz.

File metadata

  • Download URL: vgraph_forge-0.1.2.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vgraph_forge-0.1.2.tar.gz
Algorithm Hash digest
SHA256 38fe9c7580f47f01685b5b16d879892925706c9bae259fef8fc33b7e921e7a45
MD5 18a96800a6a7963223c53c281c73577e
BLAKE2b-256 e0962b94dfe3f765d0c2641726550008d1532f9060492594bf4d13fa5708cd60

See more details on using hashes here.

File details

Details for the file vgraph_forge-0.1.2-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: vgraph_forge-0.1.2-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 146.6 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vgraph_forge-0.1.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 2af6db9f86f49cf9e6da3f53b71312dcdecd59e375c8d8e82c65a16ff49b1c7b
MD5 1552c93e928cda4792f782c557a7d6cb
BLAKE2b-256 602d83fa1a2c312030caf53916899b8b537b245cdf19e9f0dbe1459b3c2d7373

See more details on using hashes here.

File details

Details for the file vgraph_forge-0.1.2-cp39-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for vgraph_forge-0.1.2-cp39-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8534151bea8430a2599e00030264f0918e342354700aaa823233c8bc12b666e3
MD5 c6105003aaaf5ad39847b1fde401fa57
BLAKE2b-256 23490ae8825505706213e90344d97f12b17ebcfb2a4938d6b3a6935c514013dc

See more details on using hashes here.

File details

Details for the file vgraph_forge-0.1.2-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vgraph_forge-0.1.2-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 11f9e460956eaae96ad4ac877cfbc14c94609e978f5675322041a96072d6e07d
MD5 91ee7c4b3c2fbb4fa0a0e56bcb7b03c0
BLAKE2b-256 172a9212acd4a1456ead02fd46558c229437560fd3484981d6425e5ff49f8f6f

See more details on using hashes here.

File details

Details for the file vgraph_forge-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for vgraph_forge-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 332cc306bb6b03a2648ec12e46f443b74df14dc785c264e1d8f2d40a6bfa0ca5
MD5 4b0df42acf10a7251db853de2e03dc0a
BLAKE2b-256 96638aa56507fdbe93f220c12e0b2fd6601ecfd93a64e9208950e4d790f86c75

See more details on using hashes here.

Supported by

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