qunits logo qunits logo

A performant, verbose and generic physical unit system.

Static Badge Static Badge

© 2026 Patrick Müller. All rights reserved.

qunits.unit

The qunits.unit module provides the Unit and the Quantity classes. Units are combined with *, / and **, and multiplying a number or a numpy array with a unit creates a quantity. The page of Quantity lists the supported arithmetic and numpy functions.

Type aliases:
int_likeint | np.integer

A Python or numpy integer.

float_likefloat | np.floating

A Python or numpy float.

scalarint_like | float_like

A Python or numpy integer or float.

array_likeArrayLike

Anything that np.asarray converts to an array, e.g. a number, a list or an array.