Skip to main content

Red Black Graph - AVOS algebra for graph computation

Project description

CI Coverage PyPi PyPi Python 3.12 Python 3.11 Python 3.10

Red-Black Graph - A DAG of Multiple, Interleaved Binary Trees

Introduction

Red-Black Graphs are a specific type of graph, a directed acyclic graph of interleaved binary trees. This data structure resulted from exploration of efficient representations for family history. This package presents and implements the underlying linear algebra as well as discusses some interesting applications.

This python module extends both scipy and numpy and also conforms to dockerutils conventions for building and running docker images used in module development. There is a script in the bin directory that can be used to setup the project for development or to prep for reading the notebook. (bin/setup-project.sh). You will want to create an activate a virtual environment prior to running the script.

Reading the Notebook

A research paper describing the linear algebra underlying Red-Black graphs as well as examples of application can be found in the Jupyter notebook, "Red Black Graph - A DAG of Multiple, Interleaved Binary Trees.ipynb". To access the notebook after you've setup the project for development, simply:

  • run-image notebook
  • open http://localhost:8888/lab

If you'd prefer to read hard copy, simply run:

`bin/generate-pdf.sh notebooks/Red Black Graph - A DAG of Multiple, Interleaved Binary Trees.ipynb` 

A pdf file will be generated into the build/latex-{datestamped} directory.

To Try Things Out...

Run the following:

# use crawl-fs to extract a sample data set from FamilySearch
pip install fs-crawler
crawl-fs -i <FamilySearch Ids to seed crawl> -o <output-directory> -b <name portion of output file>

# this will generate a <name>.vertices.csv and <name>.edges.csv file which can be ingested into a RedBlackGraph
pip install RedBlackGraph
# use rbgcf to generate both a simple form and cannonical form of a Red Black Graph (xlsx files)
rbgcf -f <directory and base name of vertices and edges file> -o <output-directory>

# Use excel to view output
 

Building from Source

RedBlackGraph uses the Meson build system (as of version 0.5.0, migrated from numpy.distutils).

Requirements

  • Python 3.10, 3.11, or 3.12
  • Meson >= 1.2.0
  • Ninja build tool
  • Cython >= 3.0
  • NumPy 1.26+ (including NumPy 2.x)

Build and Install

# Install build dependencies
pip install meson-python meson ninja cython numpy

# Build and install in development mode
pip install -e . --no-build-isolation

# Or build wheel
pip install build
python -m build

Note on uv users: If you're using uv as your package manager, you may encounter build errors with uv pip install -e . due to temporary build directory issues with ninja. Use standard pip with --no-build-isolation instead:

# For uv users - use pip directly
.venv/bin/pip install -e . --no-build-isolation

The Meson build system compiles all C/C++ extensions and Cython modules automatically.

Building and Publishing Wheels

RedBlackGraph uses cibuildwheel to build wheels for multiple platforms and Python versions.

Quick Start

# Build wheels for current platform
./bin/build-wheels-cibuildwheel.sh

# Or use cibuildwheel directly
pip install cibuildwheel
cibuildwheel --platform auto --output-dir wheelhouse

Automated Release

Wheels are automatically built and published to PyPI when a version tag is pushed:

git tag -a v0.5.1 -m "Release version 0.5.1"
git push origin v0.5.1

For detailed instructions, see:

A Note on Implementations

  • redblackgraph.reference - a pure python implementation. This simple implementation is intended primarily for illustrative purposes.
  • redblackgraph.matrix and redblackgrpah.array - a Numpy C-API extension for efficient computation with the matrix multiplication operator, @, overloaded to support avos sum and product.
  • redblackgraph.sparse_matrix - an optimized implementation built on scipy's sparse matrix implementation.

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

redblackgraph-0.6.0.tar.gz (590.8 kB view details)

Uploaded Source

Built Distributions

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

redblackgraph-0.6.0-cp312-cp312-win_amd64.whl (778.8 kB view details)

Uploaded CPython 3.12Windows x86-64

redblackgraph-0.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (773.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

redblackgraph-0.6.0-cp312-cp312-macosx_11_0_arm64.whl (560.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

redblackgraph-0.6.0-cp312-cp312-macosx_10_9_x86_64.whl (604.9 kB view details)

Uploaded CPython 3.12macOS 10.9+ x86-64

redblackgraph-0.6.0-cp311-cp311-win_amd64.whl (792.2 kB view details)

Uploaded CPython 3.11Windows x86-64

redblackgraph-0.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (800.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

redblackgraph-0.6.0-cp311-cp311-macosx_11_0_arm64.whl (564.5 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

redblackgraph-0.6.0-cp311-cp311-macosx_10_9_x86_64.whl (607.8 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

redblackgraph-0.6.0-cp310-cp310-win_amd64.whl (792.5 kB view details)

Uploaded CPython 3.10Windows x86-64

redblackgraph-0.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (800.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

redblackgraph-0.6.0-cp310-cp310-macosx_11_0_arm64.whl (566.6 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

redblackgraph-0.6.0-cp310-cp310-macosx_10_9_x86_64.whl (611.7 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

File details

Details for the file redblackgraph-0.6.0.tar.gz.

File metadata

  • Download URL: redblackgraph-0.6.0.tar.gz
  • Upload date:
  • Size: 590.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for redblackgraph-0.6.0.tar.gz
Algorithm Hash digest
SHA256 e411e70464cc14c38be031fb62f3a3ae0fa8aeec8b57d736ed4a8ec811ecf3b6
MD5 4d85d94170283f9d1fdde6d2e9dea0c8
BLAKE2b-256 cc1371ad3002c7844b8a5b6c706cd71430fba0d625f8162cec5fceeb88d4a134

See more details on using hashes here.

Provenance

The following attestation bundles were made for redblackgraph-0.6.0.tar.gz:

Publisher: release.yml on rappdw/redblackgraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file redblackgraph-0.6.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for redblackgraph-0.6.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f3e783884d4fb002069542d2d545afd078a6ab7d8681b1f92501a264749d0d77
MD5 43628ab3def1c2e9dd2ae14a184b1b35
BLAKE2b-256 ba67878ad311e9c775a4e1e64b37a2427bf9d97b3c6316ce5a5cec4f8ce102e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for redblackgraph-0.6.0-cp312-cp312-win_amd64.whl:

Publisher: release.yml on rappdw/redblackgraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file redblackgraph-0.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for redblackgraph-0.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fcd6e79e42edf1b82ef546f230f8a2cf43d77829919e54b3da0081dbdfc20168
MD5 f988025375b5826723197b63c93147ad
BLAKE2b-256 18876fe592c71188237bbfbcb775cc6af7116203ed31a09ade12259c0d44e872

See more details on using hashes here.

Provenance

The following attestation bundles were made for redblackgraph-0.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on rappdw/redblackgraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file redblackgraph-0.6.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for redblackgraph-0.6.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 157d64f2c835492df286616bb862dd16e7ae7b051993fef174b64d2b276c335c
MD5 e59260c4e56b25c01db4a6f60eabc065
BLAKE2b-256 a4ded072fd9ac84ad004eece2081ed023a8f2e51efb8c04bdcb892d12f338da3

See more details on using hashes here.

Provenance

The following attestation bundles were made for redblackgraph-0.6.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on rappdw/redblackgraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file redblackgraph-0.6.0-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for redblackgraph-0.6.0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a9ca6a8ca2f7a01fccb1fef1ce4f6b7910102178e6b9b762ac554df4952af957
MD5 08c10afa121daa5b98acd497d45e7f47
BLAKE2b-256 606fd316902092eeb486d120969ebdc92ab1b03830e07902ffc8dbd48e9c4cd0

See more details on using hashes here.

Provenance

The following attestation bundles were made for redblackgraph-0.6.0-cp312-cp312-macosx_10_9_x86_64.whl:

Publisher: release.yml on rappdw/redblackgraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file redblackgraph-0.6.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for redblackgraph-0.6.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bf65fa7e2e3223072f05ca7107c2a3c7293c0dc96e19ac46a68acae5a6fd95b8
MD5 98f8f2fec6e45ace2837309d5b98e5aa
BLAKE2b-256 27e781578b82e77c86603d3f4936b467b5352df08835708d6b7dd524cc53d678

See more details on using hashes here.

Provenance

The following attestation bundles were made for redblackgraph-0.6.0-cp311-cp311-win_amd64.whl:

Publisher: release.yml on rappdw/redblackgraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file redblackgraph-0.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for redblackgraph-0.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 191a9f03a14be8d28f18863deaa49ba2a12859c8bfb6704c67f3532a832ac198
MD5 c33ccfea99a8e69a1897d3692ce8e33b
BLAKE2b-256 24ee24290518f274a93e271e577c953bfd56c7ef9040c5f935bf480724f8ea8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for redblackgraph-0.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on rappdw/redblackgraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file redblackgraph-0.6.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for redblackgraph-0.6.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0f704ac680a061d3af80d2863d9d0c63875141b3e3490406a81eed869ff119d6
MD5 1eb7c4ae7b96aca89a8bc5c9e5cf0828
BLAKE2b-256 c77516a4b454d9e437b5000e7c5a79914da290e6c53754a682d76d2403321629

See more details on using hashes here.

Provenance

The following attestation bundles were made for redblackgraph-0.6.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on rappdw/redblackgraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file redblackgraph-0.6.0-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for redblackgraph-0.6.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c554c64cca103ca9ddfcc595384531d29f71ca93c1e3d1976a6c3b7c332c4f5d
MD5 669dbf205e6f317fe6c234a4a7dd048b
BLAKE2b-256 537da4e869c355e82a9e1e10ee80e3946cc3c77b1ca977c0d9815370ec6bfc46

See more details on using hashes here.

Provenance

The following attestation bundles were made for redblackgraph-0.6.0-cp311-cp311-macosx_10_9_x86_64.whl:

Publisher: release.yml on rappdw/redblackgraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file redblackgraph-0.6.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for redblackgraph-0.6.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 073ca3774d9de3122f471ea80a2808cff3d5e9dd34a42c9e6594b03ac31890da
MD5 f006ed170667a7e81f072b1357c5d6b5
BLAKE2b-256 f7a1885b7afc0d6b6315d5409de9430956c4b740d22216332b79c4a07f680abf

See more details on using hashes here.

Provenance

The following attestation bundles were made for redblackgraph-0.6.0-cp310-cp310-win_amd64.whl:

Publisher: release.yml on rappdw/redblackgraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file redblackgraph-0.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for redblackgraph-0.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 668635eaae7549be81d436fec1151c621d5df9b7a9d92224dc8f204a992800a0
MD5 21ab0205dfce7edb6da2d423eda2ccb0
BLAKE2b-256 ceb4b7dcf00ca3cb5e22e4d86fe9ce57aa2c9e02ebbf9472d4c3d074381532f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for redblackgraph-0.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on rappdw/redblackgraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file redblackgraph-0.6.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for redblackgraph-0.6.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a5d06cd982de21f9f84037bc7bff7c8c16e9f52728496b0d384b05b5312176ed
MD5 d595e4e6a2cdcfa15215c52a24a088c3
BLAKE2b-256 31a3a8729cf1b2571d61e63c8733f6e3ea37f7112838bc8182ad424fd5a309a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for redblackgraph-0.6.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: release.yml on rappdw/redblackgraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file redblackgraph-0.6.0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for redblackgraph-0.6.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 246a8966ba611031801576db0eb0b5e73247820fc49d38f2423fdeb9651152f2
MD5 41a2fa3f20ab630a739c3776adc59594
BLAKE2b-256 18415b3e0afe19c3b3dff26346fcd6583a9cacafb88f1e18c59c1fcfe148bcd1

See more details on using hashes here.

Provenance

The following attestation bundles were made for redblackgraph-0.6.0-cp310-cp310-macosx_10_9_x86_64.whl:

Publisher: release.yml on rappdw/redblackgraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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