Skip to main content

Python package to manage units for physical quantities

Project description

https://img.shields.io/pypi/v/barril.svg https://img.shields.io/pypi/pyversions/barril.svg https://img.shields.io/travis/ESSS/barril.svg https://ci.appveyor.com/api/projects/status/2y9spccc6pk9gh96/branch/master?svg=true https://codecov.io/gh/ESSS/barril/branch/master/graph/badge.svg https://img.shields.io/readthedocs/pip.svg

What is Barril?

Python package to manage units for physical quantities.

Quick example:

from barril.units import Scalar

s1 = Scalar(10, 'm')
s2 = Scalar(500, 'cm')
assert s1 + s2 == Scalar(15, 'm')

Features

  • Pre-defined unit database containing several physical quantities for the Oil & Gas industry.

  • Data types with an associated unit: Scalar, Array, Quantity, FixedArray.

  • Automatic conversion during arithmetic operations.

Development

For complete description of what type of contributions are possible, see the full CONTRIBUTING guide.

Here is a quick summary of the steps necessary to setup your environment to contribute to barril.

  1. Create a virtual environment and activate it:

    $ python -m virtualenv .env
    $ .env\Scripts\activate  # windows
    $ source .env/bin/activate  # linux
  2. Update pip:

    $ python -m pip install -U pip
  3. Install development dependencies:

    $ pip install -e .[testing]
  4. Install pre-commit:

    $ pre-commit install
  5. Run tests:

    $ pytest --pyargs barril
  6. Generate docs locally:

    $ tox -e docs

    The documentation files will be generated in docs/_build.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

1.7.0 (2019-06-18)

  • Add unit system.

1.6.1 (2019-04-11)

  • Change export to include ICurve and Curve and exclude IReadOnlyScalar.

1.6.0 (2019-04-10)

  • Add curve implementation.

  • Add support to interfaces from oop-ext.

  • Drop support to Python 2.

1.5.0 (2019-01-09)

  • Quantity.CheckValue now raises QuantityValidationError instead of ValueError.

1.4.0 (2018-12-17)

  • Add new category for “concentration ratio”.

1.3.0 (2018-10-13)

  • Add “per micrometre” unit to “per length” category.

  • Remove internal barril.fixtures module as it is not necessary or part of the public API.

1.2.0 (2018-09-26)

  • Add units for defining Spring-Dashpot movements.

1.1.0 (2018-09-24)

  • Add number and fraction properties to FractionValue.

  • Add unit read-only property to Quantity.

1.0.0 (2018-09-21)

  • First feature release.

0.1.0 (2018-09-03)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

barril-1.7.0.tar.gz (168.5 kB view hashes)

Uploaded Source

Built Distribution

barril-1.7.0-py2.py3-none-any.whl (153.6 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page