Skip to main content

A fast, typed, resizable, Cython array.

Project description

cyarray: a typed, re-sizable Cython array

CI Status Documentation Status

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cyarray-1.2.tar.gz (26.3 kB view details)

Uploaded Source

File details

Details for the file cyarray-1.2.tar.gz.

File metadata

  • Download URL: cyarray-1.2.tar.gz
  • Upload date:
  • Size: 26.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for cyarray-1.2.tar.gz
Algorithm Hash digest
SHA256 e2acc00ddd17ac1e94d89c659ba242c092ef9ad408c5c42ec83077226c9477d5
MD5 2170b3a2dbebb16fd208ace61ec30c34
BLAKE2b-256 6453d333386a3be6ee83cc4f3003d87a7fd4a99311a09fe93d17d2eaa979f628

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page