
Security News
NVD Quietly Sweeps 100K+ CVEs Into a “Deferred” Black Hole
NVD now marks all pre-2018 CVEs as "Deferred," signaling it will no longer enrich older vulnerabilities, further eroding trust in its data.
.. image:: https://img.shields.io/pypi/v/barril.svg :target: https://pypi.python.org/pypi/barril
.. image:: https://img.shields.io/pypi/pyversions/barril.svg :target: https://pypi.org/project/barril
.. image:: https://github.com/ESSS/barril/workflows/test/badge.svg :target: https://github.com/ESSS/barril/actions
.. image:: https://codecov.io/gh/ESSS/barril/branch/master/graph/badge.svg :target: https://codecov.io/gh/ESSS/barril
.. image:: https://img.shields.io/readthedocs/barril.svg :target: https://barril.readthedocs.io/en/latest/
.. image:: https://sonarcloud.io/api/project_badges/measure?project=ESSS_barril&metric=alert_status :target: https://sonarcloud.io/project/overview?id=ESSS_barril
Python package to manage units for physical quantities.
Quick example:
.. code-block:: python
from barril.units import Scalar
s1 = Scalar(10, "m")
s2 = Scalar(500, "cm")
assert s1 + s2 == Scalar(15, "m")
Scalar
, Array
, Quantity
, FixedArray
.For complete description of what type of contributions are possible,
see the full CONTRIBUTING <CONTRIBUTING.rst>
_ guide.
Here is a quick summary of the steps necessary to setup your environment to contribute to barril
.
#. 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.
#. Update pip
::
$ python -m pip install -U pip
#. Install development dependencies::
$ pip install -e .[testing]
#. Install pre-commit::
$ pre-commit install
#. Run tests::
$ pytest --pyargs barril
#. Generate docs locally::
$ tox -e docs
The documentation files will be generated in docs/_build
.
A reminder for the maintainers on how to make a new release.
Note that the VERSION should folow the semantic versioning as X.Y.Z Ex.: v1.0.5
release-VERSION
branch from upstream/master
.CHANGELOG.rst
.VERSION
tag to upstream
.This package was created with Cookiecutter_ and the audreyr/cookiecutter-pypackage
_ project template.
.. _audreyr/cookiecutter-pypackage
: https://github.com/audreyr/cookiecutter-pypackage
.. _GitHub page
: https://github.com/ESSS/barril
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _pytest: https://github.com/pytest-dev/pytest
.. _tox: https://github.com/tox-dev/tox
henry solubility coefficient
(mol/m3.Pa
)crystallization kinetic rate
(mol/m2.s.Pa
)density derivative in respect to enthalpy
(default unit: kg2/m3.J
).forchheimer linear productivity index
and forchheimer linear productivity index
.forchheimer linear productivity index
and forchheimer quadratic productivity index
.forchheimer linear productivity index
and forchheimer quadratic productivity index
.lbmol
mole per mass
categorymole per mass
quantity.molality
category.cubic meter per day per kilogram-force per square centimeter
(m3/d/kgf/cm2
) unit to productivity index
category.Pa(g)
, kPa(g)
, bar(g)
, and kgf/cm2(g)
to pressure
category.mole per mass
quantity (mol/kg
).Newton second per meter
unit from Ns/m
to N.s/m
to get unit display consistent with other units in the same category (support for the old unit input added).force per velocity squared
quantity (N.s2/m2
, lbf.s2/ft2
, lbf.s2/in2
, kgf.s2/m2
).barril
is now fully type annotated, being tested with mypy
.Array
and FixedArray
are Generic
subclasses, parametrized by the container type.kilkodynes
(unit=kdyne) fixed to kilodynes
, killowatts/cubic metre degree Kelvin
(unit=kW/m3.K) fixed to kilowatts/cubic metre degree Kelvin
.St
).TypeCheckingSupport
from oop-ext 1.1
.cubic feet per day per psi
(ft3/psi.d
) unit to productivity index
category.calories/metre hour degree Celsius
(cal/m.h.degC
) unit to thermal conductivity
category.calorie/hour square metre deg C
(cal/h.m2.degC
) unit to heat transfer coefficient
category.std cubic metres/second
(sm3/s
) unit to standard volume per time
category.million std cubic feet/stock tank barrel
(MMscf/stb
), stock tank barrel/std cubic feet
(stb/scf
) and stock tank barrel/million std cubic feet
(stb/MMscf
) units to standard volume per standard volume
category.thermodynamic temperature
as default category for degF
and degR
units.classmethod
Array.FromScalars
that creates an Array
from a List[Scalar]
.bbl/s
).sm3/sm3
from "volume per volume" to "standard volume per standard volume"._foundation
has been renamed to _util
, and a lot of functions which were not being
used anymore have been removed.kg.K/mol
).1000ft3/d
became Mcf/d
).
The old representation of those units is still supported, but they will be automatically translated during Quantity
creation, so this change should not affect users much.1.0 / a
where a
is a Scalar
or Array
and also add support for floor
division, i.e., operations like a // b
where a
and b
are Scalar
or Array
(and combinations with float
or int
).K/Pa
).kg/m3.K
)./
and -
operators for FixedArray
.Quantity.CheckValue
now raises QuantityValidationError
instead of ValueError
.barril.fixtures
module as it is not necessary or part of the public API.number
and fraction
properties to FractionValue
.unit
read-only property to Quantity
.FAQs
Python package to manage units for physical quantities
We found that barril demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NVD now marks all pre-2018 CVEs as "Deferred," signaling it will no longer enrich older vulnerabilities, further eroding trust in its data.
Research
Security News
Lazarus-linked threat actors expand their npm malware campaign with new RAT loaders, hex obfuscation, and over 5,600 downloads across 11 packages.
Security News
Safari 18.4 adds support for Iterator Helpers and two other TC39 JavaScript features, bringing full cross-browser coverage to key parts of the ECMAScript spec.