Skip to main content

vlsi

Variable-Length-Spatial-Index (or velvet-silk) is an implementation of variable length datatype for 3-dimensional array. It is designed with write-once-read-many paradigm, and is thus optimized for fast and memory efficient read operations.

Background

see background.md

Specification

see specifications.md

Usages

A trivial example is included below. For more realistic usages, please refer to e2e tests.

import numpy as np
from vlsi import WritableSpatialIndex, ReadableSpatialIndex, SpatialIndexWriteExc

def main():

    windex = WritableSpatialIndex("testfile")
    windex.write(
        [
            [0, 0, 0],
            [42, 42, 42],
        ],
        [b"origin of life", b"meaning of life"],
    )
    windex.write([[0, 0, 0]], [b"another write"])
    windex.save(np.eye(4), shape=(100, 200, 100))

    try:
        windex.write([[0, 0, 0]], [b"should fail"])
    except SpatialIndexWriteExc:
        ...

    try:
        windex.save(np.eye(4), shape=(100, 200, 100))
    except SpatialIndexWriteExc:
        ...

        
    rindex = ReadableSpatialIndex("testfile")
    assert rindex.read([[0, 0, 0]]) == [b"origin of lifeanother write"]
    assert rindex.read([[42, 42, 42]]) == [b"meaning of life"]
    assert rindex.read([[1, 1, 1]]) == []

if __name__ == "__main__":
    main()

Similar projects

sparseindex in siibra-python (original inspiration of this project)

v2 sparsedex in siibra-python (first implementation of vlsi)

vlen codec in numcodecs

numpy.save

LICENSE

apache 2.0

Metadata

Release files for vlsi 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vlsi 0.0.8
File Size Uploaded
vlsi-0.0.8.tar.gz 37.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vlsi 0.0.8
File Interpreter ABI Platform
vlsi-0.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 50.7 kB

Release files / vlsi-0.0.8.tar.gz

Download URL vlsi-0.0.8.tar.gz
Size 37.9 kB
Tags Source
SHA-256 checksum
How to use checksums
891d47a3cdf2a58882df98a59d3ed6dda49accba8fb52ef0ffd0e7abd42832b0
BLAKE2b-256 checksum
How to use checksums
8c031a6d7eb1cc17436c2a93bfc1ac3a4382e08329621db89c88abadb150177a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / vlsi-0.0.8-py3-none-any.whl

Download URL vlsi-0.0.8-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cbf5b8b63b4fa923dde496a2716aa3773a113bbb7c4f565b8f19642962c5003a
BLAKE2b-256 checksum
How to use checksums
a412731a9caa483bca8b80b2643362025a4dae700c879bbbd2d93ef4fcb98057
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

0.0.8 This release

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page