GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • unyt
  • Installation
  • Working with unyt
  • Listing of Units
  • API Documentation
  • Contributing
  • Citing unyt
  • Credits
  • History

This view

  • Original page
  • New address

GeezerVison is showing unyt.readthedocs.io — unyt — unyt 3.3.0.dev0 documentation

unyt¶

This is the documentation for unyt (pronounced like “unit”). unyt is a Python library for working with data that has physical units. It was originally developed as part of the yt Project and was split out as an independent project so that other Python projects can easily make use of it.

The unyt library defines the unyt.array.unyt_array and unyt.array.unyt_quantity classes for handling arrays and scalars with units, respectively.

In addition, unyt provides a number of predefined units and physical constants that can be directly imported from from the unyt namespace:

>>> from unyt import G, Mearth, Rearth
>>> v_esc = (2 * G * Mearth / Rearth) ** (1.0 / 2)
>>> print(v_esc.to("km/s"))
11.254544657958482 km/s

Contents:

  • Installation
    • Stable release
    • From source
    • Running the tests
  • Working with unyt
    • Basic Usage
      • An Example from High School Physics
      • Arithmetic and units
      • Powers, Logarithms, Exponentials, and Trigonometric Functions
      • Printing Units
      • Simplifying Units
      • Checking Units
      • Temperature Units
    • Unit Conversions and Unit Systems
      • Converting Data to Arbitrary Units
      • Converting Units In-Place
      • Converting to MKS and CGS Base Units
      • Metallicity Unit Conversions
      • Other Unit Systems
    • Equivalencies
    • Dealing with code that doesn’t use unyt
      • Stripping units off of data
      • Applying units to data
      • Working with code that uses astropy.units
      • Working with code that uses Pint
      • Reading quantities from text
    • User-Defined Units
    • Dealing with data types
    • Integrating unyt Into a Python Library
      • Unit registries
      • Custom Unit Systems
      • Writing Data with Units to Disk
      • Handling errors from unyt
      • Performance Considerations
    • unyt_array.name attribute
    • Plotting with Matplotlib
    • Working with Dask arrays
  • Listing of Units
  • Listing of Physical Constants
  • API Documentation
    • test()
    • Submodules
      • unyt.array module
      • unyt.dask_array module
      • unyt.dimensions module
      • unyt.equivalencies module
      • unyt.exceptions module
      • unyt.mpl_interface module
      • unyt.physical_constants module
      • unyt.testing module
      • unyt.unit_object module
      • unyt.unit_registry module
      • unyt.unit_symbols module
      • unyt.unit_systems module
  • Contributing
    • Code of Conduct
    • Types of Contributions
      • Report Bugs
      • Fix Bugs
      • Implement Features
      • Write Documentation
      • Submit Feedback
    • Get Started!
    • Testing unyt
    • Pull Request Guidelines
    • Deploying
  • Citing unyt
  • Credits
    • Contributors
  • History
    • 3.2.0 (2026-10-16)
    • 3.1.0 (2026-01-12)
    • 3.0.4 (2025-03-13)
    • 3.0.3 (2024-07-02)
    • 3.0.2 (2024-03-13)
    • 3.0.1 (2023-11-02)
    • 3.0.0 (2023-11-01)
    • 2.9.5 (2023-02-22)
    • 2.9.4 (2023-02-06)
    • 2.9.3 (2022-12-07)
    • 2.9.2 (2022-07-20)
    • 2.9.0 (2022-07-14)
    • 2.8.0 (2020-10-05)
    • 2.7.2 (2020-06-29)
    • 2.7.1 (2020-02-17)
    • 2.7.0 (2020-02-06)
    • 2.6.0 (2020-01-22)
    • 2.5.0 (2020-01-20)
    • 2.4.1 (2020-01-10)
    • 2.4.0 (2019-10-25)
    • 2.3.1 (2019-08-21)
    • 2.3.0 (2019-08-14)
    • 2.2.2 (2019-07-03)
    • 2.2.1 (2019-07-02)
    • 2.2.0 (2019-04-03)
    • 2.1.1 (2019-03-27)
    • 2.1.0 (2019-03-26)
    • 2.0.0 (2019-03-08)
    • 1.0.7 (2018-08-13)
    • 1.0.6 (2018-08-13)
    • 1.0.5 (2018-08-03)
    • 1.0.4 (2018-06-08)
    • 1.0.3 (2018-06-06)
    • 1.0.2 (2018-06-06)
    • 1.0.1 (2018-05-24)
    • 1.0.0 (2018-05-24)

Indices and tables¶

  • Index

  • Module Index

  • Search Page

©2022, The yt Project. | Powered by Sphinx 9.1.0 & Alabaster 1.0.0 | Page source
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.