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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.15+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.15+ x86-64

libraryfemtherm-0.21.3-cp311-cp311-win_amd64.whl (2.5 MB view details)

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

libraryfemtherm-0.21.3-cp311-cp311-macosx_10_15_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.11macOS 10.15+ x86-64

File details

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

File metadata

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

File hashes

Hashes for libraryfemtherm-0.21.3.tar.gz
Algorithm Hash digest
SHA256 5f3c6a2ed83803fbb981138e23289917b4c35db772502742f6f22a8637315075
MD5 2e9aa3936fc875f1a25e1421e3d2e953
BLAKE2b-256 8eeb5b4fbad200dd6272d6c1bdb255f5b1041cf32c78e2def2c6623d56f71205

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.21.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1fc304171426fc7eefa64448bdd85946909e93b3613d52bea3512421ac32a488
MD5 01c00c8ac4300f31a029e77245140496
BLAKE2b-256 ad8b506f19d3b8f46c06dfc8b714f66d5888f57da491c60fcc6c45668a3133ce

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.21.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 118b43d45a35262b3d2a32563ca2e89d173380ab92fc89043b8777cdbd8288ef
MD5 5ed4315f1d9dca7668925f167843766f
BLAKE2b-256 564a74936a87a341d5f2157ff48bfde6e13382e6df7004e5193b7623a7db6c60

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.21.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 75676a43dfd751afeca1da0cbac0a58c6de01bc839a897b84d2ee1446605e975
MD5 3f4ccaeda6012a21a4024462c373f8b1
BLAKE2b-256 34d064f77a61683e3febe029845a6848cb6bff4d565f41e8ce4779f85fb0b0e9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.21.3-cp313-cp313-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 4d6587b3d741cad3cc651360a59f15c63071a1c6c1bd704078125179699f4c4e
MD5 b196616e9dbcec28054aead6260f731b
BLAKE2b-256 9e1a0a5156fd8ef9de2863441d333852d91dcceb2275ff7a0b1b543a57ab4f66

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.21.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a5842d2dc1937184c30e9d72546eea0b87eb365632442662152354512c917fbe
MD5 d24c0ac30e2479aa8bc7b6b9ecaf33a7
BLAKE2b-256 7c984e1902c7e27f0cca3e77069ef2596308298abd14a7b5393f4d138765f388

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.21.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 03a95819c51808f3074e39e9df25550a21bc2fca8f0a5dd300dd69f490878f82
MD5 c8c7521e4683bb5de507ade9ba11c7a8
BLAKE2b-256 9c7d32ce40a9c84aa10a22a3d6c056ac8f77c0cef06d2a04c9aff41bbebaa952

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.21.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 42d19f0a930061c8d9fa4b41d6987ab3628eed33ee07e0a0b81acfb6e6c6b288
MD5 555b5bfdc32ab41bf769cb0c9e1db115
BLAKE2b-256 1f839e3618ef18e65dbcdb0de21308d2b96979f5bc19c5bdb3502d31aa48ad65

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.21.3-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 06d8ece1f3461c0c3fd1481a93f9e743533ee8a6e1f7108fe6cc29e21ff05dd9
MD5 b0b7e73af704eef8625734f7038e0a6d
BLAKE2b-256 522201d45a59e04749fc67c5e8a38e68f422b7d9b0330f0dae76644c6d5cf1d1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.21.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a349144fe2a7d093197559b7391751fe5f4dae76419f1f8409441d4f61327483
MD5 d011ec998e5cf6ffd684b8de597bdf3d
BLAKE2b-256 f8bc24d3aa0517634cdc13dba3a0d0207ad5ef816f1c964a66ead1f7249cfd93

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.21.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f116c99706fde26d226444cb379ab680c6db812a3fff6ee50f8ba65567f00b79
MD5 0358e4dda963365e5c306dbddfb84f28
BLAKE2b-256 b3f21c4f06f570bb71c086ce43f74829f2553c267bbb66115ed29a0ad1893d88

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.21.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4c33ef981c4c89ba87a49140bfe1f08a285569cfdc660ec5887fdf071a634729
MD5 a1dbd17cb628e94e97863149d90dc58a
BLAKE2b-256 5fba54ab704234f30161167e8372a58d3b71294746f39f0574aada4b9e3818c0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.21.3-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 da36983c5246baac08b9f0fd84ef3fc24cb1a5c7b44185d2dd2258a38c1807e0
MD5 85581db4dd763ac1db70b2bd70d62b23
BLAKE2b-256 c2f68e94cb6dd3097b6511cc55d084ec65ea1f050e5be42407e035bd5e47cbd9

See more details on using hashes here.

Provenance

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