Skip to main content

A package for handling numpy arrays with units

Project description

====
unyt
====


.. image:: https://img.shields.io/pypi/v/unyt.svg
:target: https://pypi-hypernode.com/pypi/unyt

.. image:: https://img.shields.io/travis/yt-project/unyt.svg
:target: https://travis-ci.org/yt-project/unyt

.. image:: https://ci.appveyor.com/api/projects/status/4j1nxunkj759pgo0?svg=true
:target: https://ci.appveyor.com/project/ngoldbaum/unyt

.. image:: https://readthedocs.org/projects/unyt/badge/?version=latest
:target: https://unyt.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

.. image:: https://codecov.io/gh/yt-project/unyt/branch/master/graph/badge.svg
:target: https://codecov.io/gh/yt-project/unyt
:alt: Test Coverage



.. raw:: html

<br/><a href="https://yt-project.org"><img src="docs/_static/yt_logo.png" width="200"></a>

A package for handling numpy arrays with units.

Often writing code that deals with data that has units can be confusing. A
function might return an array but at least with plain NumPy arrays, there is no
way to easily tell what the units of the data are without somehow knowing *a
prioi*.

The ``unyt`` package (pronounced like "unit") provides a subclass of NumPy's
``ndarray`` class that knows about units. For example, one could do:

>>> import unyt as u
>>> distance_traveled = [3.4, 5.8, 7.2] * u.mile
>>> print(distance_traveled.to('km'))
[ 5.4717696 9.3341952 11.5872768] km

And a whole lot more! See `the documentation <http://unyt.readthedocs.io>`_ for
more examples as well as full API docs.

This package only depends on ``numpy``, ``sympy``, ``six`` and, on Python 2.7,
``backports.functools_lru_cache`` (a backport of ``functools.lru_cache``).
Notably, it does *not* depend on ``yt`` and it is written in pure Python.

Code of Conduct
---------------

The ``unyt`` package is part of `The yt Project
<https://yt-project.org>`_. Participating in ``unyt`` development therefore
happens under the auspices of the `yt community code of conduct
<http://yt-project.org/doc/developing/developing.html#yt-community-code-of-conduct>`_. If
for any reason you feel that the code of conduct has been violated, please send
an e-mail to confidential@yt-project.org with details describing the
incident. All emails sent to this address will be treated with the strictest
confidence by an individual who does not normally participate in yt development.

License
-------

The unyt package is licensed under the BSD 3-clause license.

Citation
--------

If you make use of unyt in a publication we would appreciate a mention in the text of the paper or in the acknowledgements.


=======
History
=======

unyt began life as a submodule of yt named yt.units.

It was separated from yt.units as its own package in 2018.

1.0.2 (2018-06-06)
------------------

* Added a paper to be submitted to the Journal of Open Source Software.
* Tweaks for the readme

1.0.1 (2018-05-24)
------------------

* Don't use setup_requires in setup.py

1.0.0 (2018-05-24)
------------------

* First release on PyPI.


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

unyt-1.0.2.tar.gz (145.5 kB view details)

Uploaded Source

Built Distribution

unyt-1.0.2-py2.py3-none-any.whl (50.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file unyt-1.0.2.tar.gz.

File metadata

  • Download URL: unyt-1.0.2.tar.gz
  • Upload date:
  • Size: 145.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for unyt-1.0.2.tar.gz
Algorithm Hash digest
SHA256 c55722e31eb1f7c2823859741c7eae7985df6134dab771e862ca9daf1070b3e3
MD5 d0acfb876173974e575743db8535c989
BLAKE2b-256 4135e6bec5fa2d8853a357430ce424c0befd99f3f9a49812de63bb8369d719d5

See more details on using hashes here.

File details

Details for the file unyt-1.0.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for unyt-1.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a0c2088137b3151c87c693c291ddebc568a65f60952a408b9001c94d0c6bd8ec
MD5 3704afa19eefaa58493936a884116f2a
BLAKE2b-256 74433d68088de474826a8b1063eed19f870d68dda68084bc7792faeb152c4210

See more details on using hashes here.

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