si-units


Namesi-units JSON
Version 0.8.0 PyPI version JSON
download
home_pagehttps://github.com/itt-ustutt/quantity/tree/master/si-units
SummaryRepresentation of SI unit valued scalars and arrays.
upload_time2024-04-11 13:27:40
maintainerNone
docs_urlNone
authorPhilipp Rehner <prehner@ethz.ch>, Gernot Bauer <bauer@itt.uni-stuttgart.de>
requires_pythonNone
licenseMIT OR Apache-2.0
keywords physics units si
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # si-units

[![crate](https://img.shields.io/crates/v/quantity.svg)](https://crates.io/crates/quantity)
[![documentation](https://docs.rs/quantity/badge.svg)](https://docs.rs/quantity)
[![documentation](https://img.shields.io/badge/docs-github--pages-blue)](https://itt-ustutt.github.io/quantity/index.html)
[![PyPI version](https://badge.fury.io/py/si_units.svg)](https://badge.fury.io/py/si_units)

Representation of SI unit valued scalars and arrays. Python bindings to the [quantity](https://crates.io/crates/quantity) Rust library.

The package is written with flexibility in mind and is able to represent arbitrarily complex units.
Additional to simple scalar quantities, it also provides utilities for vector valued quantities based on numpy, where all entries share the same unit.

## Installation and Usage

You can install the python package from source (you need a rust compiler for that):

```
pip install git+https://github.com/itt-ustutt/quantity
```

or get the compiled files from PyPI

```
pip install si-units
```

## Examples

Calculate the pressure of an ideal gas.

```python
from si_units import *
temperature = 25.0 * CELSIUS
volume = 1.5 * METER**3
moles = 75.0 * MOL
pressure = moles * RGAS * temperature / volume
print(pressure) # 123.94785148011941 kPa
```

`numpy` functions can be used with SI units:

```python
from si_units import *
import numpy as np
ms = np.linspace(2.0, 4.0, 3) * METER
sqms = ms**2
print(sqms) # [4, 9, 16] m²
print(sqms.sqrt()) # [2, 3, 4] m
```

## Documentation

For the documentation, see [here](https://itt-ustutt.github.io/quantity/index.html).


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/itt-ustutt/quantity/tree/master/si-units",
    "name": "si-units",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "physics, units, SI",
    "author": "Philipp Rehner <prehner@ethz.ch>, Gernot Bauer <bauer@itt.uni-stuttgart.de>",
    "author_email": "Philipp Rehner <prehner@ethz.ch>, Gernot Bauer <bauer@itt.uni-stuttgart.de>",
    "download_url": null,
    "platform": null,
    "description": "# si-units\n\n[![crate](https://img.shields.io/crates/v/quantity.svg)](https://crates.io/crates/quantity)\n[![documentation](https://docs.rs/quantity/badge.svg)](https://docs.rs/quantity)\n[![documentation](https://img.shields.io/badge/docs-github--pages-blue)](https://itt-ustutt.github.io/quantity/index.html)\n[![PyPI version](https://badge.fury.io/py/si_units.svg)](https://badge.fury.io/py/si_units)\n\nRepresentation of SI unit valued scalars and arrays. Python bindings to the [quantity](https://crates.io/crates/quantity) Rust library.\n\nThe package is written with flexibility in mind and is able to represent arbitrarily complex units.\nAdditional to simple scalar quantities, it also provides utilities for vector valued quantities based on numpy, where all entries share the same unit.\n\n## Installation and Usage\n\nYou can install the python package from source (you need a rust compiler for that):\n\n```\npip install git+https://github.com/itt-ustutt/quantity\n```\n\nor get the compiled files from PyPI\n\n```\npip install si-units\n```\n\n## Examples\n\nCalculate the pressure of an ideal gas.\n\n```python\nfrom si_units import *\ntemperature = 25.0 * CELSIUS\nvolume = 1.5 * METER**3\nmoles = 75.0 * MOL\npressure = moles * RGAS * temperature / volume\nprint(pressure) # 123.94785148011941 kPa\n```\n\n`numpy` functions can be used with SI units:\n\n```python\nfrom si_units import *\nimport numpy as np\nms = np.linspace(2.0, 4.0, 3) * METER\nsqms = ms**2\nprint(sqms) # [4, 9, 16] m\u00b2\nprint(sqms.sqrt()) # [2, 3, 4] m\n```\n\n## Documentation\n\nFor the documentation, see [here](https://itt-ustutt.github.io/quantity/index.html).\n\n",
    "bugtrack_url": null,
    "license": "MIT OR Apache-2.0",
    "summary": "Representation of SI unit valued scalars and arrays.",
    "version": "0.8.0",
    "project_urls": {
        "Homepage": "https://github.com/itt-ustutt/quantity/tree/master/si-units",
        "Source Code": "https://github.com/itt-ustutt/quantity"
    },
    "split_keywords": [
        "physics",
        " units",
        " si"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1a39d84ddef95c7ead8878ff710c961a53c1a72fc19fe39189c627e9a413fc1e",
                "md5": "f1343b5f206cfe90973d79ce232342ac",
                "sha256": "0f8f3fdbeafecfdb61aa94ab1564e15fabe8957086bb3aa079c4313215e25dc8"
            },
            "downloads": -1,
            "filename": "si_units-0.8.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl",
            "has_sig": false,
            "md5_digest": "f1343b5f206cfe90973d79ce232342ac",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": null,
            "size": 2165315,
            "upload_time": "2024-04-11T13:27:40",
            "upload_time_iso_8601": "2024-04-11T13:27:40.348589Z",
            "url": "https://files.pythonhosted.org/packages/1a/39/d84ddef95c7ead8878ff710c961a53c1a72fc19fe39189c627e9a413fc1e/si_units-0.8.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cb105f31c62dd9d539c51a4970d018898162eeb00356ca1e1771778fb6aa4373",
                "md5": "0b6aafcaa8babff05dd8759c88b1573a",
                "sha256": "3a62303980db43d13e753556e84ef57e64370c0044d5cf2c5c48d7a5a622a332"
            },
            "downloads": -1,
            "filename": "si_units-0.8.0-cp37-abi3-macosx_10_12_x86_64.whl",
            "has_sig": false,
            "md5_digest": "0b6aafcaa8babff05dd8759c88b1573a",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": null,
            "size": 1127998,
            "upload_time": "2024-04-11T13:27:42",
            "upload_time_iso_8601": "2024-04-11T13:27:42.110375Z",
            "url": "https://files.pythonhosted.org/packages/cb/10/5f31c62dd9d539c51a4970d018898162eeb00356ca1e1771778fb6aa4373/si_units-0.8.0-cp37-abi3-macosx_10_12_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8f4c145cf776b0592ecb3ed9dc4cde9c6c20e498077ab50d60974bd2a919681a",
                "md5": "127dee2a92095053556c3e9e73b7530c",
                "sha256": "c2a67322ead74783cb114f5839d0459fb4458fe9a5221f214caa5ed1f5f8fc35"
            },
            "downloads": -1,
            "filename": "si_units-0.8.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "127dee2a92095053556c3e9e73b7530c",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": null,
            "size": 1260713,
            "upload_time": "2024-04-11T13:27:43",
            "upload_time_iso_8601": "2024-04-11T13:27:43.712963Z",
            "url": "https://files.pythonhosted.org/packages/8f/4c/145cf776b0592ecb3ed9dc4cde9c6c20e498077ab50d60974bd2a919681a/si_units-0.8.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1c3bcb944b8db953e3c1ae9fbf5843d6bcfd68ebb6e9704e8d88160371185bd0",
                "md5": "46160b3ca1e36648f719d57fa211afef",
                "sha256": "b0d93f822da87390e68b3067430d71cea3d8db0b512614cd655952504c27c2bd"
            },
            "downloads": -1,
            "filename": "si_units-0.8.0-cp37-abi3-win32.whl",
            "has_sig": false,
            "md5_digest": "46160b3ca1e36648f719d57fa211afef",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": null,
            "size": 860498,
            "upload_time": "2024-04-11T13:27:45",
            "upload_time_iso_8601": "2024-04-11T13:27:45.150313Z",
            "url": "https://files.pythonhosted.org/packages/1c/3b/cb944b8db953e3c1ae9fbf5843d6bcfd68ebb6e9704e8d88160371185bd0/si_units-0.8.0-cp37-abi3-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aacc0546cc1eee23c4edd707a755f2fafd639151a9bd31e7f32ef87b47351168",
                "md5": "906facdbec681e8ebac226622f00b77d",
                "sha256": "ebc8bd11bb522d30ecc340ebf0419e08c5024d4d2655c3abbeca9289f3665bdb"
            },
            "downloads": -1,
            "filename": "si_units-0.8.0-cp37-abi3-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "906facdbec681e8ebac226622f00b77d",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": null,
            "size": 950280,
            "upload_time": "2024-04-11T13:27:47",
            "upload_time_iso_8601": "2024-04-11T13:27:47.415461Z",
            "url": "https://files.pythonhosted.org/packages/aa/cc/0546cc1eee23c4edd707a755f2fafd639151a9bd31e7f32ef87b47351168/si_units-0.8.0-cp37-abi3-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-11 13:27:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "itt-ustutt",
    "github_project": "quantity",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "si-units"
}
        
Elapsed time: 0.22684s