1 file was added to this release more than 14 days after its initial publication. Inspect the release files before installing.
thermal-comfort-omp
This version is compiled with OpenMPI support. For single core processing use
thermal-comfort instead.
You can set the environment variable OMP_NUM_CORES=<number of cores> to control how
many cores are used by the package. Using too many cores can lead to degraded
performance.
Installation
via pypi
pip install thermal-comfort-omp
For every release, pre-compiled ABI-3 wheels are provided under releases
Run the tests
On version 3.12 for example...
tox -e py312
Documentation
Docs can be found here: https://rubclim.github.io/thermal-comfort/.
Quick start
The thermal-comfort package provides a limited set of commonly used functions. Which work for scalar values, but are mainly optimized for large array calculation of hundreds of thousands of values.
scalars
from thermal_comfort import utci_approx
utci_approx(ta=20.3, tmrt=50.9, v=2.7, rh=50.5)
arrays
1-dimensional arrays
import numpy as np
from thermal_comfort import utci_approx
utci_approx(
ta=np.array([20.3, 28.5]),
tmrt=np.array([50.9, 70.3]),
v=np.array([2.7, 1.9]),
rh=np.array([50.5, 70.3]),
)
n-dimensional arrays
The functions only accept 1-dimensional arrays, multi dimensional arrays must be reshaped before and after.
import numpy as np
from thermal_comfort import utci_approx
# 2D arrays e.g. a raster
ta = np.array([[20.3, 28.5], [20.3, 28.5]])
tmrt = np.array([[50.9, 70.3], [50.9, 70.3]])
v = np.array([[2.7, 1.9], [2.7, 1.9]])
rh = np.array([[50.5, 70.3], [50.5, 70.3]])
# retrieve the initial shape
orig_shape = ta.shape
# reshape the array to be 1-dimensional
ta = np.ravel(ta)
tmrt = np.ravel(tmrt)
v = np.ravel(v)
rh = np.ravel(rh)
# calculate the UTCI along the 1-dimensional array
utci = utci_approx( ta=ta, tmrt=tmrt, v=v, rh=rh)
# restore the original shape
utci = utci.reshape(orig_shape)
API
For a complete documentation look at the docs
Mean Radiant Temperature (MRT)
Calculate the mean radiant temperature based on DIN EN ISO 7726.
mean_radiant_temp(ta, tg, v, d = 0.15, e = 0.95)
ta: air temperature in °Ctg: black globe temperature in °C
UTCI
Calculate the Universal Thermal Climate Index (UTCI)
utci_approx(ta, tmrt, v, rh)
ta: Air temperature in °Ctmrt: Mean radiant temperature in °Cv: Wind speed in m/srh: Relative humidity in %
PET
Calculate the Physiological Equivalent Temperature (PET).
pet_static(ta, tmrt, v, rh, p)
ta: air temperature in °Crh: relative humidity in %v: wind speed in m/stmrt: mean radiant temperature in °Cp: atmospheric pressure in hPa
Heat Index
Calculate the heat index following Steadman R.G (1979) & Rothfusz L.P (1990).
heat_index(ta, rh)
ta: air temperature in °Crh: relative humidity in %
Extended Heat Index
Calculate the heat index following Steadman R.G (1979) & Rothfusz L.P (1990), but extends the range following The National Weather Service Weather Predicion Center.
heat_index_extended(ta, rh)
ta: air temperature in °Crh: relative humidity in %
Wet Bulb Temperature (TWB)
Calculate the wet bulb temperature following the Stull (2011) equation
wet_bulb_temp(ta, rh)
ta: air temperature in °Crh: relative humidity in %
Saturation Vapor Pressure
Over water
sat_vap_press_water(ta)
ta: air temperature in °C
Over ice
sat_vap_press_ice(ta)
ta: air temperature in °C
Dew Point Temperature
dew_point(ta, rh)
ta: air temperature in °Crh: relative humidity in %
Absolute Humidity
absolute_humidity(ta, rh)
ta: air temperature in °Crh: relative humidity in %
Specific Humidity
specific_humidity(ta, rh)
ta: air temperature in °Crh: relative humidity in %
Performance
The benchmark was ran using an array of 100,000 values and 4 threads
(OMP_NUM_THREADS=4). See the benchmark directory for more details on the benchmarks.
The hardware used is:
- 2x AMD EPYC 7702 64-Core Processor
- ubuntu 22.04
using an array of length 100,000 the following results were found:
comparing to pythermalcomfort
| Benchmark | pythermalcomfort (bf9febd) | thermal-comfort | thermal-comfort (unsafe) | thermal-comfort (Open MPI) | thermal-comfort (unsafe & Open MPI) |
|---|---|---|---|---|---|
| tmrt scalar | 21.0 us | 20.3 us: 1.03x faster | 2.21 us: 9.50x faster | 23.3 us: 1.11x slower | 4.38 us: 4.79x faster |
| tmrt array | 11.9 ms | 5.77 ms: 2.06x faster | 11.3 ms: 1.05x faster | 3.86 ms: 3.07x faster | 1.29 ms: 9.17x faster |
| twb scalar | 11.2 us | 2.43 us: 4.59x faster | 1.31 us: 8.52x faster | 2.44 us: 4.57x faster | 1.27 us: 8.80x faster |
| twb array | 8.86 ms | 2.54 ms: 3.49x faster | 2.52 ms: 3.52x faster | 2.63 ms: 3.37x faster | 1.73 ms: 5.13x faster |
| heat index scalar | 34.9 us | 2.38 us: 14.67x faster | 1.24 us: 28.10x faster | 5.06 us: 6.89x faster | 3.68 us: 9.47x faster |
| heat index array | 4.06 ms | 2.27 ms: 1.79x faster | 2.44 ms: 1.66x faster | 1.92 ms: 2.11x faster | 859 us: 4.72x faster |
| utci scalar | 59.5 us | 22.7 us: 2.62x faster | 2.23 us: 26.66x faster | 26.0 us: 2.29x faster | 4.45 us: 13.36x faster |
| utci array | 37.1 ms | 5.93 ms: 6.25x faster | 11.4 ms: 3.25x faster | 3.82 ms: 9.71x faster | 1.24 ms: 29.84x faster |
| pet scalar | 6.04 ms | 5.86 us: 1031.44x faster | 6.73 us: 897.57x faster | 8.68 us: 696.14x faster | 6.56 us: 922.14x faster |
| pet array | 189 sec | 284 ms: 665.14x faster | 804 ms: 234.82x faster | 117 ms: 1611.19x faster | 113 ms: 1669.13x faster |
| Geometric mean | (ref) | 10.00x faster | 13.83x faster | 10.45x faster | 23.64x faster |
comparing to umep
| Benchmark | umep | umep (njit) |
pythermalcomfort (bf9febd) | thermal-comfort | thermal-comfort (unsafe) | thermal-comfort (Open MPI) | thermal-comfort (unsafe & Open MPI) |
|---|---|---|---|---|---|---|---|
| utci scalar | 44.5 us | 6.56 us: 6.79x faster | 59.5 us: 1.34x slower | 22.7 us: 1.96x faster | 2.23 us: 19.97x faster | 26.0 us: 1.72x faster | 4.45 us: 10.00x faster |
| utci array | 6.87 sec | 313 ms: 21.95x faster | 37.1 ms: 185.23x faster | 5.93 ms: 1157.28x faster | 11.4 ms: 602.16x faster | 3.82 ms: 1798.79x faster | 1.24 ms: 5526.68x faster |
| pet scalar | 388 us | 3.17 us: 122.51x faster | 6.04 ms: 15.56x slower | 5.86 us: 66.29x faster | 6.73 us: 57.69x faster | 8.68 us: 44.74x faster | 6.56 us: 59.26x faster |
| pet array | 62.6 sec | 1.33 sec: 48.25x faster | 189 sec: 3.02x slower | 284 ms: 220.43x faster | 804 ms: 77.82x faster | 117 ms: 533.95x faster | 113 ms: 553.15x faster |
| Geometric mean | (ref) | 35.61x faster | 2.07x faster | 53.17x faster | 88.52x faster | 51.68x faster | 148.51x faster |
While njit already gives a huge performance boost, the difference between umep
(njit) and thermal-comfort increases for larger arrays e.g. 1,000,000 values as shown
here:
| Benchmark | umep (njit) |
thermal-comfort |
|---|---|---|
| utci scalar | 6.53 us | 22.9 us: 3.51x slower |
| utci array | 3.09 sec | 48.5 ms: 63.77x faster |
| pet scalar | 3.15 us | 5.84 us: 1.85x slower |
| pet array | 13.3 sec | 2.80 sec: 4.75x faster |
| Geometric mean | (ref) | 2.61x faster |
Compilation
You can set the cmake flag -DUSE_OPENMP=1 to compile the package with
OpenMP support
Metadata
Release files for thermal-comfort-omp 1.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
File added late
1 file was uploaded more than 14 days after the first file in this release.
While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.
We recommend inspecting the release files before installing.
Built distributions (wheels)
Total release size: 19.2 MB
Release files / thermal_comfort_omp-1.1.5-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
File added late
This file was uploaded more than 14 days after the first file in this release.
While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.
We recommend inspecting the release file before installing.
| Download URL | thermal_comfort_omp-1.1.5-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
10f9ad6ca8243a4363f932eed8980ec0d882b722ba75af21698fd12fe0f027ae
|
|
BLAKE2b-256 checksum How to use checksums |
4b016ff15099407349ee46125a3a5b99c4461e64118a9bce9c5854ee8cf1dfb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / thermal_comfort_omp-1.1.5-cp313-cp313-musllinux_1_2_x86_64.whl
| Download URL | thermal_comfort_omp-1.1.5-cp313-cp313-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.13 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
ce34caef149a919e457819c76d74d6eb868c837a1b9ffaa04c28b03dadc4c121
|
|
BLAKE2b-256 checksum How to use checksums |
52d0aa63f5a443debb79730b7b55c56926fe31662d6517c3642040ab8ddad14a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / thermal_comfort_omp-1.1.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | thermal_comfort_omp-1.1.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
fff19ff41e03e73fb8cde863789f0ad63caa57d72de06a1cb945d55315a4d98f
|
|
BLAKE2b-256 checksum How to use checksums |
b70549e66d7d32407c586f929f0ef28643f334faedca40baee42cb68dddbce4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / thermal_comfort_omp-1.1.5-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
| Download URL | thermal_comfort_omp-1.1.5-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 641.3 kB |
| Tags | CPython 3.13 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
88e7cfa1e3f87cab003ba836d8d7d043d808c0f2709c544e116c45bf392eda8d
|
|
BLAKE2b-256 checksum How to use checksums |
4d430933fc84bfabf5b4dc6127e7085eb926f5a838e242322ff1255892f6cf81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / thermal_comfort_omp-1.1.5-cp312-cp312-musllinux_1_2_x86_64.whl
| Download URL | thermal_comfort_omp-1.1.5-cp312-cp312-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.12 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
9ddd1c97ee6aa1b50a9bbf57f4d4f6ed2d0dc80022c84f1ef18454742e2f4c1c
|
|
BLAKE2b-256 checksum How to use checksums |
7af99d8d48788ba90946191b030a53207e32d65f1b6e9ed36cff5c85a4a15175
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / thermal_comfort_omp-1.1.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | thermal_comfort_omp-1.1.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
cdfa2f95fec0882e02da2d3d5a4cea8609d8e6e2cf6128e0e12da3ca3107d6f9
|
|
BLAKE2b-256 checksum How to use checksums |
fc4765711440fd4bfdffceb0d2bd6d38b8de8ce5306831915797575d05065124
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / thermal_comfort_omp-1.1.5-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
| Download URL | thermal_comfort_omp-1.1.5-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 641.3 kB |
| Tags | CPython 3.12 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
5c008f87a72bfc3ce0d0f9031b8b6d58427b17f4ad3a55760aa31478d0b4b82f
|
|
BLAKE2b-256 checksum How to use checksums |
9b070a817dd16eca2feb5e40c6473d996d4fb7a3d6108d92b5749556fd7a9892
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / thermal_comfort_omp-1.1.5-cp311-cp311-musllinux_1_2_x86_64.whl
| Download URL | thermal_comfort_omp-1.1.5-cp311-cp311-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
02bb6363854af02261f3cfbc696a03a27ba6376d430f2ff0c2752bb33474f2b5
|
|
BLAKE2b-256 checksum How to use checksums |
5963d2772efad0707a1bf04bd377032a1eea57c37cd0b53f777e01ac25c04cea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / thermal_comfort_omp-1.1.5-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | thermal_comfort_omp-1.1.5-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
26b953da22a3c6e6aa0e57c311cf51b52b552398f4bb16466137ec0528f8b2e0
|
|
BLAKE2b-256 checksum How to use checksums |
4805954a80c9a19c07dc3f8c31593ff3c85bd3e504005257da8a0333c5561055
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / thermal_comfort_omp-1.1.5-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
| Download URL | thermal_comfort_omp-1.1.5-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 641.0 kB |
| Tags | CPython 3.11 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
0ecdbae997b8678e6192793f83f3e771d0ba3e67cd8e2dfdacb7b71fb643501f
|
|
BLAKE2b-256 checksum How to use checksums |
8456b0a94211d6b0474376f40c021592df8af36aae5f2c07a4bd9179e3060a34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / thermal_comfort_omp-1.1.5-cp310-cp310-musllinux_1_2_x86_64.whl
| Download URL | thermal_comfort_omp-1.1.5-cp310-cp310-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
5cea98db983d9647fb273e9ecfe102adcabf648875a652a4994dfe6c9eff7f28
|
|
BLAKE2b-256 checksum How to use checksums |
3c13efb30ca20336cdb27f0d428e89aabe202007f261213a5e63ffb62f2c9137
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / thermal_comfort_omp-1.1.5-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | thermal_comfort_omp-1.1.5-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
e1ddccf3533d4416132fd6f07536ee14d2d785d7e9807776c6ad087ac982da34
|
|
BLAKE2b-256 checksum How to use checksums |
9b6087056923d564765ca569e172b5a88b1ca0b7796d15e9963dc788e7876b1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / thermal_comfort_omp-1.1.5-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
| Download URL | thermal_comfort_omp-1.1.5-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 639.7 kB |
| Tags | CPython 3.10 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
078ecc988875a13251425b750b0e6345497cc9c98f69a88c8058e262804e6838
|
|
BLAKE2b-256 checksum How to use checksums |
e96dd7157bc5a05ef2992ff910a50658891369a7e710afef764b0c152f2dbfab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / thermal_comfort_omp-1.1.5-cp39-cp39-musllinux_1_2_x86_64.whl
| Download URL | thermal_comfort_omp-1.1.5-cp39-cp39-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.9 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
3c1fb41bd01c44286232e12d17b2b58cb42d2474f407e1bf03aee038395e39a9
|
|
BLAKE2b-256 checksum How to use checksums |
3ac8802a2c50a756d335ef8b485eaa147679d23a536589098febf967f80ed361
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / thermal_comfort_omp-1.1.5-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | thermal_comfort_omp-1.1.5-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.9 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
5966891748ff3c4df66904489083151882aa495e8c662af488e1e5e247bd3f8c
|
|
BLAKE2b-256 checksum How to use checksums |
b758da971c99e3e90641bbc6b074f99ef86264d1f1ff0ba75adc40c838e6d091
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / thermal_comfort_omp-1.1.5-cp39-cp39-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
| Download URL | thermal_comfort_omp-1.1.5-cp39-cp39-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 639.8 kB |
| Tags | CPython 3.9 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
96a98056c6bdac11784f20b447d45caf3a3e587e021e767928c344402e7bbe98
|
|
BLAKE2b-256 checksum How to use checksums |
a9c1ebe24aef2c9a5736676e0e5a7e0390fbaebe12ae833a41364abec58f4ffc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|