Skip to main content

A package for handling numpy arrays with units

Reason this release was yanked:

Critical bugs found after release to be fixed in 3.0.1

Project description

https://img.shields.io/pypi/v/unyt.svg conda-forge https://github.com/yt-project/unyt/actions/workflows/ci.yml/badge.svg?branch=main https://github.com/yt-project/unyt/actions/workflows/bleeding-edge.yaml/badge.svg?branch=main Documentation Status Code Paper

The yt Project

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 priori.

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 for installation instructions, more examples, and full API reference.

This package only depends on numpy and sympy. 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. Participating in unyt development therefore happens under the auspices of the 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 work that leads to a publication we would appreciate a mention in the text of the paper or in the acknowledgements along with a citation to our paper in the Journal of Open Source Software. You can use the following BibTeX:

@article{Goldbaum2018,
  doi = {10.21105/joss.00809},
  url = {https://doi.org/10.21105/joss.00809},
  year  = {2018},
  month = {aug},
  publisher = {The Open Journal},
  volume = {3},
  number = {28},
  pages = {809},
  author = {Nathan J. Goldbaum and John A. ZuHone and Matthew J. Turk and Kacper Kowalik and Anna L. Rosen},
  title = {unyt: Handle,  manipulate,  and convert data with units in Python},
  journal = {Journal of Open Source Software}
}

Or the following citation format:

Goldbaum et al., (2018). unyt: Handle, manipulate, and convert data with units in Python . Journal of Open Source Software, 3(28), 809, https://doi.org/10.21105/joss.00809

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-3.0.0.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

unyt-3.0.0-py3-none-any.whl (136.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: unyt-3.0.0.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for unyt-3.0.0.tar.gz
Algorithm Hash digest
SHA256 72e4c3f0cd943b7f444123c45b37c0c6662d5413073baef25a04a3b9a57dab4d
MD5 f247298e1bfed48552ba72dff29fd0c5
BLAKE2b-256 3f6fa97a272470f3c7211da6c1b2e370bac8d0b91c2c0f1a3fb2d5f39271b393

See more details on using hashes here.

File details

Details for the file unyt-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: unyt-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 136.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for unyt-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 67dc3c6a0fd6b424b16833189ebde89347b0b9dc1a979224c33aba70185f544e
MD5 2e337b2068775a5413c89588ae2d7e47
BLAKE2b-256 8f8adbe782625c60b8964e0758fc740d7966636591080e133f4394996b9484e0

See more details on using hashes here.

Supported by

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