Skip to main content

Python bindings for LibraryFEMTherm – THMZ file parsing and thermal simulation data

Project description

LibraryFEMTherm

C++20 static library for reading, writing, and manipulating THERM (.thmz) files. Provides data structures and serialization for thermal models, materials, boundary conditions, gases, glazing systems, and CMA data. Optional Python bindings via pybind11.

Requirements

  • CMake 3.8+
  • C++20 compiler (MSVC 2022, GCC 11+, Clang 14+)
  • Ninja or Visual Studio generator
  • Python 3.11+ (only when building Python bindings)

Building

CMake presets

CMakePresets.json ships six visible configure presets plus three hidden inheritance bases. Use the default-* presets for normal builds, local-* to consume sibling working copies of LBNL deps, and python-* to also build the Python bindings:

Preset Description Python bindings C++ tests
default-debug / default-release C++ only. Fetches all dependencies from declared remotes. OFF ON
local-debug / local-release C++ only, but consume sibling ../LBNLCPPCommon and ../FileParse working copies when present. OFF ON
python-debug / python-release C++ with Python bindings. Fetches all dependencies from declared remotes. ON ON

Missing siblings under local-* fall back to the declared remote automatically, so local-* is safe to invoke even if you don't have the LBNL siblings checked out.

cmake --preset default-release
cmake --build build/default-release --config Release --parallel
ctest --test-dir build/default-release -C Release --output-on-failure

For Python bindings:

cmake --preset python-release
cmake --build build/python-release --config Release --parallel
ctest --test-dir build/python-release -C Release -V

CLion and VS Code automatically detect these presets.

Per-machine compiler presets (CMakeUserPresets.json)

To use a specific compiler (vs2022-release, gcc-13-debug, clang-18-release, etc.), each developer maintains their own CMakeUserPresets.json next to CMakePresets.json. It is gitignored, read automatically by CMake (and CLion, VS Code, etc.), and stays on the developer's machine.

Personal presets inherit from one of the shipped presets (usually local, which gives you sibling-repo overrides for free, or python if you want bindings) and override whatever they want. A complete realistic example -- building with WSL Clang on a Windows machine, with CLion 2023.2+ routed through the WSL toolchain automatically:

{
    "version": 6,
    "configurePresets": [
        {
            "name": "clang-release",
            "displayName": "clang (Release)",
            "inherits": "local",
            "generator": "Ninja",
            "binaryDir": "${sourceDir}/build/clang-release",
            "cacheVariables": {
                "CMAKE_C_COMPILER":   "clang",
                "CMAKE_CXX_COMPILER": "clang++",
                "CMAKE_BUILD_TYPE":   "Release"
            },
            "vendor": {
                "jetbrains.com/clion": {
                    "toolchain": "WSL"
                }
            }
        }
    ]
}

Manual configuration (without presets)

cmake -G "Visual Studio 17 2022" -A x64 -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release

Add -DBUILD_PYTHON_BINDINGS=ON to include Python bindings.

CMake options

Option Default Description
BUILD_PYTHON_BINDINGS OFF Build Python bindings via pybind11
BUILD_LibraryFEMTHERM_TESTING ON Build C++ test targets

Python bindings

Install from PyPI:

pip install libraryfemtherm

Or build from source with BUILD_PYTHON_BINDINGS=ON (see above).

import pylibraryfemtherm as fem

# Load a THMZ file
model = fem.load_model_from_zip_file("sample-sill.thmz")
print(f"Polygons:   {len(model.polygons)}")
print(f"Boundaries: {len(model.boundary_conditions)}")

# Save to XML string
xml = fem.save_model_to_string(model)

# Save to a new THMZ file
fem.save_model_to_zip_file(model, "output.thmz")

# Work with ZIP contents directly
contents = fem.zip.unzip_files("sample.thmz", [fem.zip.MATERIALS_FILE_NAME])
db = fem.MaterialsDB()
db.load_from_string(contents[fem.zip.MATERIALS_FILE_NAME])

For comprehensive Python API documentation with examples, see doc/python.md.

Project structure

src/
  BCSteadyState/     # Steady-state boundary conditions
  BCTransient/       # Transient boundary conditions
  CMA/               # CMA (Component Modeling Approach) data
  Common/            # Shared utilities
  Gases/             # Gas properties and mixtures
  Materials/         # Material definitions (solid, cavity, radiation)
  THMZ/              # ThermModel, geometry, preferences, properties, zip I/O
  LibraryUtilities/  # Common helpers
  Schemas/           # XML/JSON schemas
python/
  src/               # pybind11 binding source files
  tests/             # pytest test suite
tst/
  units/             # C++ Google Test files
  products/          # Test THMZ data files
cmake/               # CMake macros and compiler config

Dependencies (fetched automatically)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

libraryfemtherm-0.23.3.tar.gz (498.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

libraryfemtherm-0.23.3-cp313-cp313-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.13Windows x86-64

libraryfemtherm-0.23.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

libraryfemtherm-0.23.3-cp313-cp313-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

libraryfemtherm-0.23.3-cp313-cp313-macosx_10_15_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.13macOS 10.15+ x86-64

libraryfemtherm-0.23.3-cp312-cp312-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.12Windows x86-64

libraryfemtherm-0.23.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

libraryfemtherm-0.23.3-cp312-cp312-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

libraryfemtherm-0.23.3-cp312-cp312-macosx_10_15_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12macOS 10.15+ x86-64

libraryfemtherm-0.23.3-cp311-cp311-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.11Windows x86-64

libraryfemtherm-0.23.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

libraryfemtherm-0.23.3-cp311-cp311-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

libraryfemtherm-0.23.3-cp311-cp311-macosx_10_15_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11macOS 10.15+ x86-64

File details

Details for the file libraryfemtherm-0.23.3.tar.gz.

File metadata

  • Download URL: libraryfemtherm-0.23.3.tar.gz
  • Upload date:
  • Size: 498.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for libraryfemtherm-0.23.3.tar.gz
Algorithm Hash digest
SHA256 05486ccc2ea38a045ed7c426ec23dcd0115b6c54587e754057bd66c4a6c4c176
MD5 f1a81c2d4d85fb0842154ac5ce86183b
BLAKE2b-256 4a4f88ad2b79eafc36c7e89eb24bd72a087e426a6b7493fe043481a89d1f5736

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.23.3.tar.gz:

Publisher: workflow.yml on LBNL-ETA/LibraryFEMTherm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libraryfemtherm-0.23.3-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for libraryfemtherm-0.23.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 8f5164ee6ee93f9b57106ce486573fda442c7c78b917d26316bf6268d1ea4fdb
MD5 d49c0112e9883bf7f4833890b59b5d4d
BLAKE2b-256 e90d2cede11b07c764633939d034934e512be7fe0d5d324a8c65ea0293dbbd10

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.23.3-cp313-cp313-win_amd64.whl:

Publisher: workflow.yml on LBNL-ETA/LibraryFEMTherm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libraryfemtherm-0.23.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for libraryfemtherm-0.23.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 44955751bd35cfe44ad63a1cc8f9a24ea0d979f7154a39aa2be68f5f954d57b1
MD5 78fe25d6057772de0301ba29dd8dbdf7
BLAKE2b-256 4aed5bcc4096ff8ab35bca730355102a1bc4ec779815b6661e90401e5a97245a

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.23.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: workflow.yml on LBNL-ETA/LibraryFEMTherm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libraryfemtherm-0.23.3-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for libraryfemtherm-0.23.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1d590f38fd6d063061ee0c4fc7234c661bb5d8937a2d9a75b646262cd2c50421
MD5 0c9445edee5abe77ad2e454ccfcb5a38
BLAKE2b-256 f585c5bc0edd8a37bdd4e9e8006be4814d2bf8b2721539af8a6b8e9e0bda529f

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.23.3-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: workflow.yml on LBNL-ETA/LibraryFEMTherm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libraryfemtherm-0.23.3-cp313-cp313-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for libraryfemtherm-0.23.3-cp313-cp313-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 2f7329480b45e7841d355ca455810650b23093e95939003fa9e4b403c131947e
MD5 352b28ccddc5eaf1f35093b216c4bdc4
BLAKE2b-256 f337928b356c6b2af234f3d065d627d27fe34b53af405eac0176734d8e0c652a

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.23.3-cp313-cp313-macosx_10_15_x86_64.whl:

Publisher: workflow.yml on LBNL-ETA/LibraryFEMTherm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libraryfemtherm-0.23.3-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for libraryfemtherm-0.23.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8580ffa698898df94e5cd9a444dec32c226760ee6619bb2e2a87d634ba330f80
MD5 772883a61b63eee19b1a7d0e4e764dcf
BLAKE2b-256 4307c6571b7b27495d9050f4e659fc916bff739b94b8f3526bd6b9521bb3f183

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.23.3-cp312-cp312-win_amd64.whl:

Publisher: workflow.yml on LBNL-ETA/LibraryFEMTherm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libraryfemtherm-0.23.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for libraryfemtherm-0.23.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 63a9814c4592231a92ef01e47cca91381704bbd30e4c499240dc602ad17d5c45
MD5 028abe96c5fd01316c393c887b4e81cc
BLAKE2b-256 a2528023ca61d1fdb20ed39ff88aa7126231d0d59336ef4c21dee0d8e4bc2977

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.23.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: workflow.yml on LBNL-ETA/LibraryFEMTherm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libraryfemtherm-0.23.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for libraryfemtherm-0.23.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a3e4854fc937b656f1255555c068c68a41932fc5467b971f5a37d1d3a5a0f70d
MD5 357999f60797f40adeea55acf2bfda01
BLAKE2b-256 5968b9a440250ef1a6ca90a086a88f7461c079fe37cc1720b36cef4685c19537

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.23.3-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: workflow.yml on LBNL-ETA/LibraryFEMTherm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libraryfemtherm-0.23.3-cp312-cp312-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for libraryfemtherm-0.23.3-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 05d079c8c8f206ad074ac2393a0ebc14280c1cc5ca77a3c9031d3b0280a7b967
MD5 e1448c27b127abf006df5d443bdda0ff
BLAKE2b-256 13230818062ae578c35f63a04d61648f8f8e871323685b1e816616dffa63520b

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.23.3-cp312-cp312-macosx_10_15_x86_64.whl:

Publisher: workflow.yml on LBNL-ETA/LibraryFEMTherm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libraryfemtherm-0.23.3-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for libraryfemtherm-0.23.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e6d232d397a05898421512f843935206bf1fe7a4d6d7b863853b3bdb2ee78824
MD5 a54f55dd66031727ac70afea119a34b0
BLAKE2b-256 972e31b87cf5a232358c2029ee860549e6ffe335be73b1960014cc158324a02a

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.23.3-cp311-cp311-win_amd64.whl:

Publisher: workflow.yml on LBNL-ETA/LibraryFEMTherm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libraryfemtherm-0.23.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for libraryfemtherm-0.23.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ea1acaa7aca6eba5df4acfd56c0c61d01a2a4020cd57e08030b07475d815f3f7
MD5 bafee132a56a71c4efdf95ca411722e1
BLAKE2b-256 ce737c88d1bf798e645f002d9e87027726fa37c27e05593cc0a1c270d9422133

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.23.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: workflow.yml on LBNL-ETA/LibraryFEMTherm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libraryfemtherm-0.23.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for libraryfemtherm-0.23.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a72a4968416573e59dd389333c9ceb693ce3be72371c862b93dfe1a477888351
MD5 ff471764a14f936b71eb583bb93ad237
BLAKE2b-256 13b74bdac8181877a7ef0d378a323c03469a561d1ebf7e4a0083114f16df661c

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.23.3-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: workflow.yml on LBNL-ETA/LibraryFEMTherm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libraryfemtherm-0.23.3-cp311-cp311-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for libraryfemtherm-0.23.3-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 dd22ed499203d8e1956e75e983da2350cdaa188ab7306d06bbc29787032c9aa2
MD5 0cf05acbf64b62d88f8214650c48998f
BLAKE2b-256 556867da444d57579dc477dbd50a9cd8e9bf3e039d9bf979bf6d8368fe1943cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.23.3-cp311-cp311-macosx_10_15_x86_64.whl:

Publisher: workflow.yml on LBNL-ETA/LibraryFEMTherm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page