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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.15+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.15+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

libraryfemtherm-0.23.1-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.1.tar.gz.

File metadata

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

File hashes

Hashes for libraryfemtherm-0.23.1.tar.gz
Algorithm Hash digest
SHA256 3bf2e9fe0005caf164fedab106bd819e1855f2fbcfc530ab7cfbce8a7e2fd4cf
MD5 bfed2f4b3f4bf5c663e0d4e6a7042bb3
BLAKE2b-256 cc1420214ff83bf475272957489bc3682275f9bf11b65f0dfc7ddf5e20e53e2a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b15f22472702a23bfba83a841c3346fbd2334a5c46f8d2478693e1db5795a88a
MD5 e70784ce94e1fd62dd4c3b433503ae08
BLAKE2b-256 1b5099f622df333d8433a680dd48a8ec6af2ed90b8f1a02754bd161ab8b3f7d8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e08b7574f01c3975329ef091655276f98afe9b1177f522b39dc727cd749a50f9
MD5 33fc08d8ccb5dd70b82ca459040df68e
BLAKE2b-256 d0d7bf1322a512a3c980aa3055e0f18e05c358a1788f19ed6de8fe903378c094

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f5b7feb0dc353ccd5e22ac0f21208fe5199077647b9fc704b372c14fc2b365ce
MD5 15f858ce5996a2abe6b0ca52926a8301
BLAKE2b-256 a54aa4fac2e3d4f8113825104d72fc3bcf2f23d85b6c095f3218870ee7dab867

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.1-cp313-cp313-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 c566c6722bc20717098259804f147dc445861c06bbe01ba5bfe2bd1b847a011f
MD5 026cb8ec2535bc693c000e98b9e119b2
BLAKE2b-256 11bb07758c01b1487fe14890f62f209fb49303b335b91bf5f5c1a897fc10b146

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6e6663032d5ecdecdebe5138fcba962d9f408f3c1b32cbb2ee39a3a24ceb96e5
MD5 502f862b7d9c6a6a6803f158b7220a48
BLAKE2b-256 72912c11fe2c61a6509dbb1ce55efc2e9c91aa37eeb855b41816c37e23af9d82

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7256b753ef185cdd54949d22fd2f871d9c275c94e21701c842237f9c229326d6
MD5 02d0c5d382a9989c3238a9165cc71f1e
BLAKE2b-256 6a83eb6892b2fc5fc56f735bd2379e6f87ddab94343e50f8640840666bf2a18b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b15f5b9acf2e8bae463e0b6fb47252c01ee220abc0bbc176cec4967a46ca029d
MD5 9e99383106b9c33f1384a4778357acbe
BLAKE2b-256 15de3cd0c1a6cb03f35b87bbc8e855fb9498ad982d40dc8d5d2f24b89347e446

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.1-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 560bc6fba73d8e1bcaa9115c5265c87c29ef72c7cce04547a9a696c22763088e
MD5 a0ba7b188603c5001b379caaee8cea7f
BLAKE2b-256 78cb962d4441751e1e672e405b16f7a178f7c0c5c0254eb8a3c0a86cc0b2a9a0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 526e3a6ef66642072c3e9148785317e0a5245a89e49a71bad5b6b138ecbcc6aa
MD5 2bf6e97c9e8c85cf35cf98233533bde9
BLAKE2b-256 e280f91063fc789db4e1593ae5d207ad0749cfe76b6b863c863e29225bfbe7fa

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5834979fb5175dcfd9cc150a441e183e2821d88c755125909a899ed88320bc79
MD5 adc89a66fa6aef4bb78933d00087a771
BLAKE2b-256 21da325300d00f96528ab2a19dc7f8667c47eb5b3ddf875a022ce76c86eb0cfe

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a68aec6406f28906db60c0604b0b9a989cff97b23a49275621fed19fbbcca27c
MD5 dd9dbbf39d7759a429a1f17c5680821f
BLAKE2b-256 e75926acd6201e520270dcfe8d715a4765962e04b5a1afb40809e4863a2df4a1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.1-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 26d7a76058e4d53485643e11548d3cf3ac61dc0cd94d8020e8590185fb5a435e
MD5 270c28948a67b309b456f7536e88f955
BLAKE2b-256 6fc9768973f169a8053c14036689c00a9862972996eb7964ca1a0bc8d89e41bc

See more details on using hashes here.

Provenance

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