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.0.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.0-cp313-cp313-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.15+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.15+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

libraryfemtherm-0.23.0-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.0.tar.gz.

File metadata

  • Download URL: libraryfemtherm-0.23.0.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.0.tar.gz
Algorithm Hash digest
SHA256 665336cc6249057237bdaa5f4672d75b8b4aac71fcf110fb9d89a4f3b7d8ccff
MD5 19538786e0bd05d5bcb0287cb930c1ef
BLAKE2b-256 5bca3bcfb2ba799a2da42ac7f8f5e208b9b367eb87b8201b92f6e7cb9fc148ce

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1b5a214415e951f32de600c4b31132eaf2b18fe9a21d80fae996af8eb1932bca
MD5 7bc086e991763503b7429fa62adc503f
BLAKE2b-256 542f7f8cebdff3122b40699a832170dfba82b32f1d47e46e669d4cf1bd8fc477

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 999f5cc0824a8d70478fc8468fd0784e48fdc7d8aca64025c6b8167215efdcc1
MD5 30b32f815ab8f6079bb83f8edec9fc35
BLAKE2b-256 dd71a3727f1dba6cdb702b2b1a31e4e501a829755115945e1e162efd57b9025a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 31db9927487825d21b2c37f19407b5bd1aed3ff25d91952ee1e11315cb5e569c
MD5 f30727868618d2ccab1774081e4cb124
BLAKE2b-256 b88c45174769ac40d599144c5fea9725be7871362fd557d676a7df6e01f07e21

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.0-cp313-cp313-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 a32083c6223a1dea6c8099edadd79b68fc552677e324788d6cc885b475382417
MD5 3b831043ea3be9009d217712e478aaf1
BLAKE2b-256 040ee8c30d58ebf9675493413b044033ec6ba35796f0315644d4769aea81f4c5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ef0034d3898579a34091df2372c3fa080c6e5576c376271fec3a87ace05ac24d
MD5 d679b4b69062a109903323b5c73fd8c9
BLAKE2b-256 64a3f26d3bbd2985ab5ff24a33e51b5f1ef165fd25c9b69230f8e9761f1758c1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d5801d822f12171f79f2ccf88c2ac2c1bb156fccf3d71a744a561e216ad57e5e
MD5 39b3487b42085f59b86258cd5be0c210
BLAKE2b-256 51785a3e85e371f993c5abfadca78c41c236fd6594f5a478b0e56b4d2bf9a261

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 26581df688b55333012bc6e2ea7c75f63ebef2ce6112cf9e5eae3240e3aeb0df
MD5 e5c7f1cf2a2026a0bd20292ab9688e49
BLAKE2b-256 e555131cbdc8ede0f19fb39f56f4f55ed0386bd05a4725df40c30a2563e9d935

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.0-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 0122a776ad4cb6949019e39002762d717db526618166ea8f2c239c377f3bab72
MD5 fd0ac0dc6fc630ae3852f2efaff76fe4
BLAKE2b-256 82c3fff8c4cd773472a152ca14fca661bf55f0d8e46819f79b7ceb4bbdebc943

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 faac4eab6101129c3c8dbd1b7d40eb711e41afaad665f49b5c7978f709ad8e20
MD5 84d124fdd7d8f026bd7d40824cfbb6ae
BLAKE2b-256 c420d385232c44c1d148ea218f3dd531e1189b67bae8473fec415b5ac8510a27

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 09bdc3986c56e7d5eed163efce54b0e32891a090a8eaf88c602be978c9656f4e
MD5 11c3bcef304e028f69749750634225bf
BLAKE2b-256 f7d0304ac58e218f2ca9ee4cf918f6e9463217c02ff31f5aac6d2b5b2fed6cb4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9903543af78eb5fa2820d328ec19761c843ab204249beb8b9415ce51cc4b6d4d
MD5 2263336093b7d78706e57fa7e5ebae82
BLAKE2b-256 d23bbf3c7afc67f50a703ebb1f53db994e77148414ace4fce2d433a5490a0345

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.0-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 7ba001037c5a4c5fe1a508705909a7632f4f1d43e440a8234daa16ec52489ddf
MD5 5d30104548360670ba4550f55e259890
BLAKE2b-256 cd22cc0c4b648e73587e0ccc793934bb4dff55395c8f0b157c6711102ce39611

See more details on using hashes here.

Provenance

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