Utilities package for Open VDS.
Project description
Introduction
OVDS-Utils is a python library implementing classes and wrapers with easier to comprehend interfaces to openvds.
Examples are:
- VDS class implementing
__getitem__
method for easy data read out and many others feature to make life easier.
To install:
Run pip install ovds-utils
or execute python setup.py install
in the source directory
Creating and reading VDS source example
You can easily create and access the VDS source/file by simply creating a VDS class instance and using __getitem__
method to read data.
import numpy as np
from ovds_utils.ovds.enums import BrickSizes
from ovds_utils.vds import VDS
shape = (251, 51, 126)
data = np.random.rand(*shape).astype(np.float32)
vds = VDS(
path="example.vds",
connection_string="",
shape=shape,
data=data,
databrick_size=BrickSizes.BrickSize_128
)
print(vds[:10,0,0])
>>> [0.14836921 0.06490713 0.05770212 0.2364456 0.49000826 0.1573576
0.5017615 0.456749 0.6573513 0.72831243]
Writing to VDS source chunk by chunk
import numpy as np
from ovds_utils.ovds.enums import BrickSizes
from ovds_utils.vds import VDS
shape = (251, 51, 126)
data = np.random.rand(*shape).astype(np.float32)
zeros = np.zeros(shape, dtype=np.float32)
vds = VDS(
path="example.vds",
connection_string="",
shape=shape,
data=zeros,
databrick_size=BrickSizes.BrickSize_64
)
for chunk in vds.channel(0).chunks():
chunk[:, :, :] = data[chunk.slices]
chunk.release()
readwrite_vds.channel(0).commit()
print(vds[:10,0,0])
>>> [0.14836921 0.06490713 0.05770212 0.2364456 0.49000826 0.1573576
0.5017615 0.456749 0.6573513 0.72831243]
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ovds_utils-0.1.4.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for ovds_utils-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 799bd260e0981d2978b6c1d12a99f6e8fd2dd376133dba444d8a00959d96dd6d |
|
MD5 | 60e875fb8a4e4a55fa6a13394cb9d64f |
|
BLAKE2b-256 | 7a14e37cbfe5e8453a1d5f73058c55d6cbb378a037e834d9f4573a3d4caceec8 |