unyt: Handle, manipulate, and convert data with units in Python
arXiv:1806.02417 · doi:10.21105/joss.00809
Abstract
Software that processes real-world data or that models a physical system must have some way of managing units. While simple approaches like the understood convention that all data are in a unit system (such as the MKS SI unit system) do work in practice, they are fraught with possible sources of error both by developers and users of the software. In this paper we present unyt, a Python library based on NumPy and SymPy for handling data that has units. It is designed both to aid quick interactive calculations and to be tightly integrated into a larger Python application or library. We compare unyt with two other Python libraries for handling units, Pint and astropy.units, and find that unyt is faster, has higher test coverage, and has fewer lines of code.
arXiv comment11 pages, 6 figures. Submitted to the Journal of Open Source Software. The source code is available at https://github.com/yt-project/unyt and the documentation is available at http://unyt.readthedocs.io/en/latest/. Accepted for publication in the Journal of Open Source Software
References in corpus (4)
Cited by in corpus (17)
- The Origins of the Circumgalactic Medium in the FIRE Simulations
- SWIFT: A modern highly-parallel gravity and smoothed particle hydrodynamics solver for astrophysical and cosmological applications
- The Fates of the Circumgalactic Medium in the FIRE Simulations
- unyt: Handle, manipulate, and convert data with units in Python
- EAGLE-Auriga: effects of different subgrid models on the baryon cycle around Milky Way-mass galaxies
- SOAP: A Python Package for Calculating the Properties of Galaxies and Halos Formed in Cosmological Simulations
- The origin of X-ray coronae around simulated disc galaxies
- Hydrodynamics and survivability during post-main-sequence planetary engulfment
- Galaxy cluster rotation revealed in the MACSIS simulations with the kinetic Sunyaev-Zeldovich effect
- If dark matter is fuzzy, the first stars form in massive pancakes
- Hybrid-chimes: A model for radiative cooling and the abundances of ions and molecules in simulations of galaxy formation
- Probing Galactic variations in the fine-structure constant using solar twin stars: systematic errors
- Resolution criteria to avoid artificial clumping in Lagrangian hydrodynamic simulations with a multi-phase interstellar medium
- Probing Galactic variations in the fine-structure constant using solar twin stars: methodology and results
- Physical-type correctness in scientific Python
- Evolution of the ZTF SLRN-2020 star-planet merger
- unxt: A Python package for unit-aware computing with JAX