How to install unxt#
unxt is on PyPI and supports the Python versions listed on its PyPI page.
pip install unxt
uv add unxt
pip install git+https://github.com/GalacticDynamics/unxt.git
git clone https://github.com/GalacticDynamics/unxt.git
cd unxt
pip install -e . # editable mode
Installing unxt brings in JAX, quax, quaxed and astropy, which is the unit backend.
Install an add-on package#
The unxts.* packages are separate distributions. Install each through the matching extra rather than by name, so that it and unxt are resolved together as a compatible set:
Extra |
Package |
Adds |
|---|---|---|
|
|
|
|
|
|
|
|
Unit-system conversion with |
|
|
Plotting quantities with |
|
|
A |
pip install "unxt[parametric]"
Two packages have no extra of their own โ install them by name:
Package |
Adds |
|---|---|
|
|
|
The abstract dispatch API. Already a dependency of |
pip install unxts.hypothesis
Everything at once#
unxt[workspace] installs every package above, unxts.hypothesis and unxts.api included. unxt[all] is workspace plus backend-astropy, which pins the astropy unit backend explicitly:
pip install "unxt[all]"
Each package has its own documentation under Packages in the sidebar.
Check it worked#
>>> import unxt as u
>>> u.Q(1.0, "m")
Quantity(Array(1., dtype=float32...), unit='m')
If that prints a quantity, you are ready for Your first calculation with units.
See also#
Your first calculation with units โ the first lesson.
How to migrate to v2 โ upgrading from
unxtv1.Contributing โ installing for development.