Metadata-Version: 2.4
Name: cyarray
Version: 1.2
Summary: A fast, typed, resizable, Cython array.
Home-page: http://github.com/pypr/cyarray
Author: Cyarray Developers
Author-email: Cyarray Developers <pysph-dev@googlegroups.com>
License: Unless otherwise specified by LICENSE.txt files in individual
        directories, all code is
        
        Copyright (c) 2009-2018, the PySPH developers
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are
        met:
        
         1. Redistributions of source code must retain the above copyright
            notice, this list of conditions and the following disclaimer.
         2. Redistributions in binary form must reproduce the above copyright
            notice, this list of conditions and the following disclaimer in
            the documentation and/or other materials provided with the
            distribution.
         3. Neither the name of the copyright holder nor the names of its contributors
            may be used to endorse or promote products derived from this software
            without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
        
Keywords: Cython,array,resizable
Platform: Linux
Platform: Mac OS-X
Platform: Unix
Platform: Windows
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Software Development :: Libraries
Description-Content-Type: text/x-rst
License-File: LICENSE.txt
Requires-Dist: numpy
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Provides-Extra: tests
Requires-Dist: pytest; extra == "tests"
Requires-Dist: pytest-benchmark[histogram]; extra == "tests"
Provides-Extra: dev
Requires-Dist: cython; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-benchmark[histogram]; extra == "dev"
Requires-Dist: sphinx; extra == "dev"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: platform

cyarray: a typed, re-sizable Cython array
------------------------------------------

|CI Status|  |Documentation Status|


.. |CI Status| image:: https://github.com/pypr/cyarray/actions/workflows/tests.yml/badge.svg
    :target: https://github.com/pypr/cyarray/actions/workflows/tests.yml

.. |Documentation Status| image:: https://readthedocs.org/projects/cyarray/badge/?version=latest
    :target: https://cyarray.readthedocs.io/en/latest/?badge=latest
    :alt: 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.

.. _pip: http://www.pip-installer.org

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.
