Skip to main content

A package for handling numpy arrays with units

Project description

unyt

https://img.shields.io/pypi/v/unyt.svg https://img.shields.io/travis/yt-project/unyt.svg https://ci.appveyor.com/api/projects/status/4j1nxunkj759pgo0?svg=true Documentation Status Test Coverage

A package for handling numpy arrays with units

Features

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 provides a subclass of NumPy’s ndarray class that knows about units. For example, one could do:

>>> import unyt
...
>>> cars = ['toyota', 'volkswagen', 'honda']
>>> distance_traveled = [3.4, 5.8, 7.2] * unyt.mile
...
>>> print(distance_traveled.to('km'))
[ 5.4717696  9.3341952 11.5872768] km

And a whole lot more! See the documentation for more examples as well as full API docs.

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.

License

The unyt package is licensed under the BSD 3-clause license. If you make use of unyt in a publication we would appreciate a mention in the text of the paper or in the acknowledgements.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

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

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

0.1.0 (2018-03-28)

  • 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.0.tar.gz (145.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unyt-1.0.0-py2.py3-none-any.whl (50.2 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for unyt-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fa21ce116c5c49da9aa55b1c383f24ae6ce8d805ec31a104358e6ad3c1ec8b07
MD5 837764f04abacffca3673b22c0a5dbe1
BLAKE2b-256 d18718d5d85c2f6dc59dc669af21659837dbd8c8cc943752928d87a1dba67ccf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for unyt-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6dbe6ae1b15f234ea177b1a179ee98edbf7f6f26d5d4caac2e16df8ec6e75629
MD5 58b848684055b372ded9cacc0e902bcc
BLAKE2b-256 064495689519356b161a811a62dea04d3199fe3bf798226967ee14b7f0125fc2

See more details on using hashes here.

Supported by

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