Skip to content
forked from ESSS/barril

Python package to manage units for physical quantities

License

Notifications You must be signed in to change notification settings

Nibodhika/barril

 
 

Repository files navigation

Barril

https://ci.appveyor.com/api/projects/status/2y9spccc6pk9gh96/branch/master?svg=true

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
    

    Note

    If you use conda, you can install virtualenv in the root environment:

    $ conda install -n root virtualenv
    

    Don't worry as this is safe to do.

  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.

About

Python package to manage units for physical quantities

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%