Representation of SI unit valued scalars and arrays.
Project description
si-units
Representation of SI unit valued scalars and arrays. Python bindings to the 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.
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:
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file si_units-0.3.2-cp36-abi3-win_amd64.whl.
File metadata
- Download URL: si_units-0.3.2-cp36-abi3-win_amd64.whl
- Upload date:
- Size: 699.5 kB
- Tags: CPython 3.6+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f35a80414a08d574f30484a1145bce3c6ac286a4027689224789fbab02f361c
|
|
| MD5 |
df330e88c556ca4df091b364dcd648b4
|
|
| BLAKE2b-256 |
eea8733495a12737e5ca001bd7b692f279408c817f9ad274467d8490ee262453
|
File details
Details for the file si_units-0.3.2-cp36-abi3-win32.whl.
File metadata
- Download URL: si_units-0.3.2-cp36-abi3-win32.whl
- Upload date:
- Size: 611.2 kB
- Tags: CPython 3.6+, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7fd23a8aeaae60e3cd7c1b3aca702665f5f426d6241f2251eec24612ec37ab8
|
|
| MD5 |
e0dc3643863e575700b24760ef7d6a30
|
|
| BLAKE2b-256 |
e5a978e73590ac84bb7edd71a961cfbdfa6714a0ebe7c7ed25896a29d024b4ff
|
File details
Details for the file si_units-0.3.2-cp36-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl.
File metadata
- Download URL: si_units-0.3.2-cp36-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.6+, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
957827c5fb5673d4f6ea0137836598f6d1c32abfd9b3e732c38c56bb0a4eb979
|
|
| MD5 |
c302b6c6693525afd47f38c67f60626b
|
|
| BLAKE2b-256 |
b6ad3a9201c6392b197fa7bb449c07010c6d44a718415db1ef4ab41b7d7a7974
|
File details
Details for the file si_units-0.3.2-cp36-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.
File metadata
- Download URL: si_units-0.3.2-cp36-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.6+, macOS 10.9+ universal2 (ARM64, x86-64), macOS 10.9+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c7006e4dbcc4beed846cfc3391de13f83bc57adcaf5181e7628ea21c9f90194
|
|
| MD5 |
eb6e08441de2e36decd12e7e24526e10
|
|
| BLAKE2b-256 |
6fc02b10ffe5be2587ac5394bc2e5513f22cdc5cb817803a31f6ccc3c5279383
|
File details
Details for the file si_units-0.3.2-cp36-abi3-macosx_10_7_x86_64.whl.
File metadata
- Download URL: si_units-0.3.2-cp36-abi3-macosx_10_7_x86_64.whl
- Upload date:
- Size: 853.5 kB
- Tags: CPython 3.6+, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c79114a9897584749cb64f7e30f953491a2c14922030aac74f29bb10f23827f
|
|
| MD5 |
007d958a4154ff8d2da2a0029c04fdcc
|
|
| BLAKE2b-256 |
17816b27a1949a7e2d60876912f81c0b12c34014cc61179c97df541c7afbd15f
|