Introduction#
named_arrays is an implementation of a
named tensor
that includes first-class support for astropy.units.
Named tensors allow the axes of an array to be referenced by name
instead of by position, which allows for more readable code and better
modularity.
named_arrays does not extend the numpy API like xarray.
Instead, it generalizes the numpy API to only use axis names instead of position.
This means that terms such as shape,
which referred to a tuple of integers in the numpy API,
is now a dict, where the keys are the axis names and the values
are the number of elements along that axis.
This forces consumers of this library to stick to the named axes,
and to not “cheat” by using positional indexing.
Many functions in the numpy API have been overridden if possible.
Other functions which are not expressible using the numpy API have
been redifined in the named_arrays namespace.
Installation#
named_arrays is published on PyPI and can be installed using:
pip install named-arrays
API Reference#
An in-depth description of the classes and functions defined in the this library.
A named tensor implementation with |
Tutorials#
Jupyter notebook examples on how to use named_arrays.
References#
Folke Eriksson. On the measure of solid angles. Mathematics Magazine, 63(3):184–187, 1990. URL: https://doi.org/10.1080/0025570X.1990.11977515, arXiv:https://doi.org/10.1080/0025570X.1990.11977515, doi:10.1080/0025570X.1990.11977515.
Gabriel Goh. Why momentum really works. Distill, 2017. URL: http://distill.pub/2017/momentum, doi:10.23915/distill.00006.
Pieter G. van Dokkum. Cosmic-Ray Rejection by Laplacian Edge Detection. \pasp , 113(789):1420–1427, November 2001. arXiv:astro-ph/0108003, doi:10.1086/323894.