Skip to main content

lwbgt

Native CI Wheel CI R package CI PyPI R-universe License

lwbgt is a stable, low-level C/FFI implementation of the Liljegren outdoor wet bulb globe temperature (WBGT) model. It preserves the original scalar ABI and documented numerical behaviour while removing repeated and dead work. Dependency-free Python and R bindings use the same native kernel. SwiftPM exposes the stable C interface as CLWBGT.

Use lwbgt as an auditable numerical backend. It deliberately leaves weather data ingestion, unit conversion, missing-data policy, heat-risk classification, and application defaults to callers. For a higher-level Python workflow, consider pywbgt or thermofeel.

Release status: v0.4.2. The tested release remains bit-identical to the retained oracle within the documented compatibility scope.

Python

python -m pip install lwbgt
from lwbgt import Input, calculate, calculate_batch, esat

weather = Input(
    year=2024, month=4, day=15, hour=14, minute=30,
    gmt_offset_hours=8, averaging_minutes=60, urban=1,
    latitude_deg_north=1.3521, longitude_deg_east=103.8198,
    solar_w_m2=742.0, pressure_hpa=1008.4,
    air_temperature_c=32.1, relative_humidity_percent=68.0,
    wind_speed_m_s=2.8, wind_height_m=10.0,
    vertical_temperature_difference_c=-0.4,
)

result = calculate(weather)
assert result.status == 0
print(result.wbgt_c)

results = calculate_batch([weather, weather])
print(esat(273.15, phase=0))

Input and Result are immutable typed records. Field names, units, status codes, and failure behaviour are defined by the ABI contract.

R

Install from R-universe:

install.packages("lwbgt", repos = "https://zyf0717.r-universe.dev")

Or install the latest GitHub release from the r/ subdirectory:

install.packages("remotes", repos = "https://cloud.r-project.org")
remotes::install_github("zyf0717/lwbgt/r@*release", upgrade = "never")

The R API provides lwbgt_input(), calculate(), and esat(). It returns ordinary data frames, recycles scalar constructor arguments, and isolates invalid or non-convergent rows. See the R quick start.

SwiftPM

Add the package and its C-library product to a Swift target:

let package = Package(
    dependencies: [
        .package(url: "https://github.com/zyf0717/lwbgt.git", from: "0.4.2"),
    ],
    targets: [
        .target(
            name: "WeatherService",
            dependencies: [
                .product(name: "CLWBGT", package: "lwbgt"),
            ]
        ),
    ]
)
import CLWBGT

CLWBGT exposes lwbgt.h directly; it is not an idiomatic Swift wrapper. SwiftPM builds the canonical C sources without vendoring or generated copies. Linux and macOS downstream consumption are tested in release mode.

Native C

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
ctest --test-dir build --output-on-failure
cmake --install build --prefix /desired/prefix

The install provides static and shared libraries, lwbgt.h, CMake package metadata, and pkg-config metadata. CMake consumers can select lwbgt::static or lwbgt::shared after find_package(lwbgt CONFIG REQUIRED). GCC, Clang/AppleClang, and MinGW GCC are supported; MSVC cannot compile the preserved K&R source.

Documentation

Topic Document
Inputs, units, layouts, status codes, and concurrency ABI contract
Numerical compatibility and measured performance Compatibility and performance
Scope and common integration questions FAQ
Package selection lwbgt vs pywbgt vs thermofeel
Source lineage Upstream provenance
Release history Changelog
Release procedure Maintainer guide

Licence and attribution

Project-authored files are Apache-2.0 licensed. The retained upstream source and modified derivative remain under the UChicago Argonne Liljegren WBGT v1.1 terms. See LICENSING.md and retain the acknowledgement in NOTICE when redistributing.

This project is not affiliated with or endorsed by the original authors, UChicago Argonne, or the U.S. Department of Energy.

Release files for lwbgt 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lwbgt 0.4.2
File Size Uploaded
lwbgt-0.4.2.tar.gz 108.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for lwbgt 0.4.2
File
lwbgt-0.4.2-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
lwbgt-0.4.2-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64, Linux glibc 2.28+ ARM64 Details
lwbgt-0.4.2-py3-none-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64, Linux glibc 2.5+ x86-64 Details
lwbgt-0.4.2-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
lwbgt-0.4.2-py3-none-macosx_10_9_x86_64.whl Python 3 none macOS 10.9+ x86-64 Details

Total release size: 217.7 kB

Release files / lwbgt-0.4.2.tar.gz

Download URL lwbgt-0.4.2.tar.gz
Size 108.1 kB
Tags Source
SHA-256 checksum
How to use checksums
eb17febfba46f93375fb8c234e79e117a82547519ad2c77f186e5e1669def132
BLAKE2b-256 checksum
How to use checksums
b01b46f33774546e76e279de7ce20f2bfd906c37c439cff52784dc63964c7f82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / lwbgt-0.4.2-py3-none-win_amd64.whl

Download URL lwbgt-0.4.2-py3-none-win_amd64.whl
Size 27.4 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
b7a92ae69096ef25310049dcef0dce0cd3107147a21d792241d0ae0a1096ae4b
BLAKE2b-256 checksum
How to use checksums
aac1620641f04e1503536cda68fd9d10c262e07d396394fa3d07381827cf3e24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / lwbgt-0.4.2-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl

Download URL lwbgt-0.4.2-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 21.4 kB
Tags Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
05fd6ea1c8c85f7606bfef34f4b43d6c8ac202b487b0e83673f13feec8bd13ec
BLAKE2b-256 checksum
How to use checksums
9dcd1b4adb42c0303fcd19040fb86044d0376a402b3e57302adee3fe794c51e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / lwbgt-0.4.2-py3-none-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl

Download URL lwbgt-0.4.2-py3-none-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Size 20.8 kB
Tags Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 Python 3
SHA-256 checksum
How to use checksums
3593d9649a4f1e816f4ef42e582c1c8609ba8c27b6c87f6b1765ba079fca5510
BLAKE2b-256 checksum
How to use checksums
c3871c2a17b8b1e116f0024f2a62256c3da48dfc3517dbf29edb32cc5e02fcc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / lwbgt-0.4.2-py3-none-macosx_11_0_arm64.whl

Download URL lwbgt-0.4.2-py3-none-macosx_11_0_arm64.whl
Size 20.4 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f9148fe2776d9832594a3d9d58e0704feffe77914b8d7edabc227c129b5f69cf
BLAKE2b-256 checksum
How to use checksums
e706a327f28ca4f685933d58414ea2904a47437b9fe6f1f3e47f054761c25887
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / lwbgt-0.4.2-py3-none-macosx_10_9_x86_64.whl

Download URL lwbgt-0.4.2-py3-none-macosx_10_9_x86_64.whl
Size 19.7 kB
Tags Python 3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
88d0feb93fbc0d4e20a5e10360f9bfb47445917f36208d38e214e0e51fa3da0d
BLAKE2b-256 checksum
How to use checksums
b5253ecfadda25a69d926830b07c64199cb7e9a1eeb770f2fbf2f7ac0b948956
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release history Release notifications | RSS feed

1.0.0

6 release files

0.4.3

6 release files

This release

0.4.2 This release

6 release files

0.4.1

6 release files

0.4.0

6 release files

0.3.0

6 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page