Questions tagged [pint]

Pint is a Python units library to perform calculations with physical quantities. Use this tag in conjunction with the [python] tag for specific programming questions using Pint.

Pint is Python package to define, operate and manipulate physical quantities: the product of a numerical value and a unit of measurement. It allows arithmetic operations between them and conversions from and to different units.

It is distributed with a comprehensive list of physical units, prefixes and constants. Due to its modular design, you can extend (or even rewrite!) the complete list without changing the source code. It supports a lot of numpy mathematical operations without monkey patching or wrapping numpy.

It has a complete test coverage. It runs in Python 2.6+ and 3.2+ with no other dependency. It licensed under BSD.

Source, more information and latest release:
https://pint.readthedocs.io/

77 questions
0
votes
0 answers

Unable to get right units when decorating a class constructor with pint

I was trying the following code, from pint import UnitRegistry ureg = UnitRegistry() Q_ = ureg.Quantity class Simple: @ureg.wraps(None, (None, None, 'm**3'), True) def __init__(self, a, b): self.a = a self.b = b def…
aaron02
  • 320
  • 2
  • 14
-1
votes
1 answer

MetPy vs Pint package compatibility error

In my Conda environment, when I run pip show MetPy, my first and last two lines are: Name: MetPy Version: 1.0 ... Requires: scipy, matplotlib, pandas, pyproj, pooch, importlib-resources, traitlets, importlib-metadata, numpy, pint,…
Stephen
  • 19
  • 4
1 2 3 4 5
6