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.22.2.tar.gz (490.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.22.2-cp313-cp313-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.13Windows x86-64

libraryfemtherm-0.22.2-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.22.2-cp313-cp313-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.15+ x86-64

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

Uploaded CPython 3.12Windows x86-64

libraryfemtherm-0.22.2-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.22.2-cp312-cp312-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.15+ x86-64

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

Uploaded CPython 3.11Windows x86-64

libraryfemtherm-0.22.2-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.22.2-cp311-cp311-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

libraryfemtherm-0.22.2-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.22.2.tar.gz.

File metadata

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

File hashes

Hashes for libraryfemtherm-0.22.2.tar.gz
Algorithm Hash digest
SHA256 76226e38b30bba4739ead1652cf76e13e305592cdbbae7a9b4eedae493871fe0
MD5 64db1e99c321169e47d95d6660eed933
BLAKE2b-256 b0c26a44e943fce408a264b1653a4d4fb94828c3aecb32fb0971015bda08cd87

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.22.2.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.22.2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for libraryfemtherm-0.22.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 cebc65cc9e0d8faa6d073d6c7bcf39dee257f95720d07e8826aa9e81b7ff9acb
MD5 fd71b17a469a5a9c98427e2767fa0570
BLAKE2b-256 08a703ecd1ac7fd42205ec3da8dbade21bae115d81f21e9a63e80133e8030267

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.22.2-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.22.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for libraryfemtherm-0.22.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3145ce8ed441ffa02ec5382f8cdd3758871ce0ce24d2a323323d5c15f970f4fb
MD5 de5dcc8f4815721b0d7cc82a4dcffd55
BLAKE2b-256 d811b2591d693cc6931b7cbc46cfe6edee38a93e2c813f91f1a1a4ed300a186f

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.22.2-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.22.2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for libraryfemtherm-0.22.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 59c6aa5d5716793c6bb9a94e62aaf8a2b2206194a56766c22a222c0e6136806a
MD5 5fabc06ebbda39d01a225199c34f0c91
BLAKE2b-256 094fb4d10bcba0ba4a245ce672c7ef54761c2c4554f0d7807e5adf72b546e320

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.22.2-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.22.2-cp313-cp313-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for libraryfemtherm-0.22.2-cp313-cp313-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 ce6a29906e90ed41626c6b0d9274d9a59c617cd799813593ae2a1f602b245eb8
MD5 6a48d32974f946603b2318688af69459
BLAKE2b-256 46303ba544eeb04e7a7d896abf4620801d81d54dbfb9536aae124f7e5491a623

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.22.2-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.22.2-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for libraryfemtherm-0.22.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1c895086c1bbaeb42ad30b3897536bcd97dd7098bc4edc26d4146d363a6d14d8
MD5 b5c30f91f895767051cca2aa12efe2ec
BLAKE2b-256 51ef03879b7aa40cf706acc9f9d9ed5b6eb04a31c7cd90b82ff9bd04093f5bc9

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.22.2-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.22.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for libraryfemtherm-0.22.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 10e022c7e44e902db0f0a21295677cea6f9f6dd1effc4013f712d948f40e765b
MD5 4daf5a2a12b4d73c7c5749871e35f18f
BLAKE2b-256 bccdbf4e9f8a2e37da9f6a3ae27a1d76c95656c57a1318e97dcf914a9b12ae3a

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.22.2-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.22.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for libraryfemtherm-0.22.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 719e947ac4fd4a4ea4251b30cc442d350e9f717e36fa981dec2807b6e2afcde9
MD5 68b1af2b3d5d457850d8341c1eb2a032
BLAKE2b-256 bac4a4fd2539273c558fe459bda805cdd1861176c2c8cd69f442ee43c5edb3bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.22.2-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.22.2-cp312-cp312-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for libraryfemtherm-0.22.2-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 8a02c8d86f34568c2d1ae959466c76e6b05f3fe267133ff7c59a7f81caec80a8
MD5 05a20263b6a79118ff5805b82f292b2c
BLAKE2b-256 8f145f9dc3bbdceed3a1d2f5b3d3a93bdbf1d79c6bd4fd9d3fef73c8a91abaf7

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.22.2-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.22.2-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for libraryfemtherm-0.22.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5ab062d2e2d5e357df28d0214285fefde58866877a5e1518b109ea70bd423ba2
MD5 b3cc8b1dd4f58b92e37ae0d53394a270
BLAKE2b-256 d3006a43a7607a01a9f3f16527b1001b96ff9b83060fe67eb465977a62e08a13

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.22.2-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.22.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for libraryfemtherm-0.22.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d145a084787e9bd0de1bfbb3bf146b917234e57c12bd046bc799e7d8646697ee
MD5 2ab95db7c2f32c3e1e2390617cf58a2b
BLAKE2b-256 485c53bea1a381b469aafc0abdc7987a5e7fad25010f533208ebe3fdf40234bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.22.2-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.22.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for libraryfemtherm-0.22.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f73230e01cc5c359405d994aef83a10844f163fc35a7013d7cf78117f2664223
MD5 337c5f1683363a22024b830147c85054
BLAKE2b-256 27b722ffb025fd6347cc08b05a15b9649b5df5d63aad972090b51e818002543a

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.22.2-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.22.2-cp311-cp311-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for libraryfemtherm-0.22.2-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 f8a4fe8d81ad9f5072269af24c2de0c2e51279b67d396351a6166b3d31d37ca8
MD5 9807c29cc4cf52a98b9791159c05b703
BLAKE2b-256 a3acf661afff5ff760db63c5a3fed2aac64b1eb8eb68784dd3aa07419d300a69

See more details on using hashes here.

Provenance

The following attestation bundles were made for libraryfemtherm-0.22.2-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