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.1.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.1-cp39-abi3-win_amd64.whl (146.6 kB view details)

Uploaded CPython 3.9+Windows x86-64

vgraph_forge-0.1.1-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.1-cp39-abi3-macosx_11_0_arm64.whl (251.3 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

vgraph_forge-0.1.1-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.1.tar.gz.

File metadata

  • Download URL: vgraph_forge-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 95f91ecf804f6f0d02034de4a4debf50791a9503000e835ee5207f39cfa729e1
MD5 0b41cc3bdc2a1b466c04202ad0fad25b
BLAKE2b-256 6b6259c20ad072e66e9e9a3db830f2d155ddda1d1f169645bd514e95a5855a4d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vgraph_forge-0.1.1-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.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 fa96d390db8075a6a2e4fe5ae4b029c9830d627e60a6ee8968fe41d31e633f64
MD5 0941d632e7762742688c6ea771ac0c7e
BLAKE2b-256 08e50595702e45e1746d9293d276fb018a39c41525a015675da84e9e174e7fea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vgraph_forge-0.1.1-cp39-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d266896cb56c474455e5d86b82de5eca1f7dae44fc74bf70796c8812e2b9f04e
MD5 c3fcc5925ffa3618d4cd90c1c5704668
BLAKE2b-256 4b7fa196b5d1b0f13e00e75a2194b1b72a12ea57d4682d6fdc9fb09246ca9158

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vgraph_forge-0.1.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f0a0fb5c58d5ed5d255745f430428c7f3326b66c5c382daba8f8e68d66933be7
MD5 b4f3a66a5b79e3f0870752f784aceb1b
BLAKE2b-256 c2f7dbea989053d1f6d24caecb2c678008b95b41026f567fcf05f6f841ee8085

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vgraph_forge-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 658867cce5fe89240604eae3e577ac2b740cf60b218362c6aed0553d84856b78
MD5 006646c4a891743c5a5b67dc45c3e796
BLAKE2b-256 0b1ab9c8448395efdc2889364adfa60c7ccb8ce14543a9d5254649fc38084f50

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