A Python package for handling physical quantities. The source code and issue tracker are hosted on github:
Get the latest version of quantities from https://pypi.python.org/pypi/quantities/
To get the git version do:
$ git clone git://github.com/python-quantities/python-quantities.git
Documentation and usage
You can find the official documenation at:
Here is a simple example:
>>> import quantities as pq >>> distance = 42*pq.metre >>> time = 17*pq.second >>> velocity = distance / time >>> velocity array(2.4705882352941178) * m/s >>> velocity + 3 Traceback (most recent call last): ... ValueError: Unable to convert between units of "dimensionless" and "m/s"
quantities has a hard dependency on the NumPy library. You should install it first, please refer to the NumPy installation guide:
To install quantities itself, then simply run:
$ python setup.py install --user
If you install it system-wide, you may need to prefix the previous command with
$ sudo python setup.py install
To execute all tests, run:
$ python setup.py test
in the current directory. The master branch is automatically tested by Travis CI.
quantities is written by Darren Dale
Quantities only uses BSD compatible code. See the Open Source Initiative licenses page for details on individual licenses.
See doc/user/license.rst for further details on the license of quantities