Skip to main content

An alternative approach to defining and viewing NumPy's arrays

Project description

An alternative approach to defining and viewing NumPy’s arrays.

>>> import numpy
>>> import nani
>>> color_type = nani.Array(
...     element_type=nani.Number(type=numpy.uint8, default=255),
...     shape=3,
...     view=None
... )
>>> dtype, default, view = nani.resolve(color_type, name='Color')
>>> element_count = 2
>>> a = numpy.array([default] * element_count, dtype=dtype)
>>> v = view(a)
>>> type(v)
<class 'nani.Color'>
>>> for color in v:
...     color
[255, 255, 255]
[255, 255, 255]

See the overview and tutorial sections from the documentation for more information.

Documentation

Read the documentation online at <http://nani.readthedocs.org> or check their source from the doc folder.

The documentation can be built in different formats using Sphinx.

Running the Tests

A suite of unit tests is available from the tests directory. You can run it by firing:

$ python tests/run.py

To run specific tests, it is possible to pass names to match in the command line.

$ python tests/run.py TestCase test_my_code

This command will run all the tests within the TestCase class as well as the individual tests which contains test_my_code in their name.

Get the Source

The source code is available from the GitHub project page.

Contributing

Found a bug or got a feature request? Don’t keep it for yourself, log a new issue on GitHub.

Author

Christopher Crouzet <christophercrouzet.com>

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

nani-0.1.1.tar.gz (24.3 kB view hashes)

Uploaded Source

Built Distribution

nani-0.1.1-py2.py3-none-any.whl (10.2 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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