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 visibility_graphs 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.0.tar.gz (16.5 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.0-cp39-abi3-win_amd64.whl (146.6 kB view details)

Uploaded CPython 3.9+Windows x86-64

vgraph_forge-0.1.0-cp39-abi3-manylinux_2_34_x86_64.whl (292.0 kB view details)

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

vgraph_forge-0.1.0-cp39-abi3-macosx_11_0_arm64.whl (251.5 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

vgraph_forge-0.1.0-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.0.tar.gz.

File metadata

  • Download URL: vgraph_forge-0.1.0.tar.gz
  • Upload date:
  • Size: 16.5 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.0.tar.gz
Algorithm Hash digest
SHA256 778f604dfd1aa2abf423ccfc8a48b2a346b79fd941a9c4ad9bf1f8df088883cf
MD5 955adae6b5df5071adff1de5af0c2740
BLAKE2b-256 a5e7b650d9472df4afd0b452ed0a3554ee2c5a5033dbcd83d4f32a644cdff521

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vgraph_forge-0.1.0-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.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1a28244c962a2565db6e10da4d30e1a5de7ab59a182aa4e2dff9cae62fa140cc
MD5 4475d5a805e1b18652993b7a7b8e1b5e
BLAKE2b-256 7a46c83360e9d0e5195b6ebff54b6afb71a40bd7bf9d9739951bf20f5281c10a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vgraph_forge-0.1.0-cp39-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 db3954ae371f94a5a30a01c10cb4cb9b65c3f996c674e548afbb5b84396c8d6b
MD5 15f2ad5515bcd2b1d5898cb710adf887
BLAKE2b-256 4146020105caa10ecd38813bb1ced5cb8b50f267ae555e97c862ea1e588faa96

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vgraph_forge-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 12e7fd4b261d26d84b86525d14ccac415f380e7d04495e93ea73a1478abdc5b8
MD5 9dcb6d93e4a775ae169127fa69674b2b
BLAKE2b-256 2c4c077f31c842d4cda207d6ecdf10df74f68664c74b3a1e467077183130e2b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vgraph_forge-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a8f5de11138ef1feba80b53e73b23c0f3c7abfc6d3f4067efa4418284f6ef7f5
MD5 5739849bc956e45d97399e5d9cd21e8f
BLAKE2b-256 8720c6ab73501bd74c58db16a28266f4fc73847e5bf2620690cdbc09ffa50ce0

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