Units

Attaching physical units directly to numbers allows things such as automatic unit conversions, and automatic unit checking. There are several packages that add such functionality to Julia.

Unitful.jl

GitHub Repo stars deps Unitful Downloads
Stable Dev GitHub last commit (branch) version Coverage

The most mature package for working with units is Unitful.jl. Is handles a wide variety of units, unit conversion, and unit checking. It describes it's goals as follows:

Unitful is a Julia package for physical units. We want to support not only SI units but also any other unit system. We also want to minimize or in some cases eliminate the run-time penalty of units. There should be facilities for dimensional analysis. All of this should integrate easily with the usual mathematical operations and collections that are found in Julia base.

There is a rich ecosystem around Unitful that implements things such as plotting recipes, and specific units for specific fields.

DynamicQuantities.jl

GitHub Repo stars deps DynamicQuantities Downloads
Stable Dev GitHub last commit (branch) version

A newer package for working with units is DynamicQuantities.jl. It describes itself as follows:

DynamicQuantities defines a simple statically-typed Quantity type for Julia. Physical dimensions are stored as a value, as opposed to a parametric type, as in Unitful.jl. This can greatly improve both runtime performance, by avoiding type instabilities, and startup time, as it avoids overspecializing methods.

UnitSystems.jl

GitHub Repo stars deps UnitSystems Downloads
GitHub last commit (branch) version Coverage

While it is not recommended above previously mentioned alternatives, there is also UnitSystems. The author can not speak to it's ability.

This section is not yet written well. If you have used or developed Julia packages in this domain, we would love your help! Please visit the "Contributing" section of the repository that hosts this website for information on contributions.

This website is a community effort covering a lot of ever-changing information. It will therefore never be complete or without error. If you see something wrong, or have something to contribute, please see the "Contributing" section in the github repository.

Last modified: January 30, 2024. Built with Franklin.jl