=========
Tinyarray
=========

Tinyarray is a numerical array module for Python.  The multi-dimensional arrays
it provides are best thought of as (possibly nested) tuples of numbers that,
unlike Python's built-in tuples, support mathematical operations.  Like tuples,
tinyarrays are hashable and immutable and thus can be used as dictionary keys.
The module's interface is a subset of that of NumPy and hence should be familiar
to many Python programmers.  Tinyarray has been heavily optimized for small
arrays: For example, common operations on 1-d arrays of length 3 run up to 35
times faster than with NumPy.  When storing many small arrays, memory
consumption is reduced by a factor of 3.  In summary, Tinyarray is a more
efficient alternative to NumPy when many separate small numerical arrays are to
be used.


License
-------

Tinyarray is licensed under the "simplified BSD License".  The license is
included in the file LICENSE in this directory.


Authors
-------

The principal developer of Tinyarray is Christoph Groth (SPSMS-INAC-CEA
Grenoble).  His contributions are part of his work at `CEA <http://cea.fr/>`_,
the French Commissariat à l'énergie atomique et aux énergies alternatives.

The author can be reached at christoph.groth@cea.fr.

Other people that have contributed to Tinyarray include

* Michael Wimmer (Leiden University)
* Joseph Weston (SPSMS-INAC-CEA Grenoble)

To find out who exactly wrote a certain part of Tinyarray, please use the
"blame" feature of `git <http://git-scm.com/>`_, the version control system.


Installation
------------

Tinyarray requires Python 2.6 or 2.7.

To install, run::

   python setup.py build
   python setup.py install


Usage
-----

At this stage, tinyarray does not provide documentation beyond this file.  See
the module docstring for a list of all the available functions and methods.  All
of them are simplified versions of their NumPy counterparts.

For example, arrays can be created with::

    tinyarray.array(arraylike, [dtype])

where `arraylike` can be a nested sequence of numbers or an object supporting
the buffer protocol.  The `dtype` parameter is optional and can only take the
values `int`, 'float`, and `complex`.  Note that `dtype` is a positional
argument and cannot be used as a keyword argument.  Arrays can be also created
with the functions `identity`, `zeros`, and `ones`.

Tinyarrays support iteration and indexing (currently without slicing), as well
as vectorized elementwise arithmetics.  A small number of operations like `dot`,
`floor`, and `transpose` are provided.  Printing works as well as pickling and
unpickling.  Whenever an operation is missing from Tinyarray, NumPy can be used
directly, e.g.: `numpy.linalg.det(my_tinyarray)`.
