A fast, typed, resizable, Cython array.
Project description
cyarray: a typed, re-sizable Cython array
The cyarray package provides a fast, typed, re-sizable, Cython array.
It currently provides the following arrays: IntArray, UIntArray, LongArray, FloatArray, DoubleArray.
All arrays provide for the following operations:
access by indexing.
access through get/set function.
resizing the array.
appending values at the end of the array.
reserving space for future appends.
access to internal data through a numpy array.
If you are writing Cython code this is a convenient array to use as it exposes the raw underlying pointer to the data. For example if you use a FloatArray and access its data attribute it will be a float*.
Each array also provides an interface to its data through a numpy array. This is done through the get_npy_array function. The returned numpy array can be used just like any other numpy array but for the following restrictions:
the array may not be resized.
references of this array should not be kept.
slices of this array may not be made.
The numpy array may however be copied and used in any manner.
Installation
cyarray can be installed using pip:
$ pip install cyarray
The package requires Cython, numpy, and mako to be installed and also requires a suitably configured C/C++ compiler.
Usage
In Python one may import and use the package as:
from cyarray.api import IntArray a = IntArray(10)
Here a is an array of 10 integers.
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
File details
Details for the file cyarray-1.1.tar.gz
.
File metadata
- Download URL: cyarray-1.1.tar.gz
- Upload date:
- Size: 27.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/38.5.2 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00e1271e66e5f82ff846e054a61f78e22e04589253b7705813ea8a624642a402 |
|
MD5 | b1e0f0d7bb6763345c2b506921f21587 |
|
BLAKE2b-256 | 3aa7f6e320afb1136d5173c7eddbe2c8ad47b5118286a6262a3cae51bb1c80c7 |