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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.15+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.15+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

libraryfemtherm-0.23.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.23.2.tar.gz.

File metadata

  • Download URL: libraryfemtherm-0.23.2.tar.gz
  • Upload date:
  • Size: 497.6 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.2.tar.gz
Algorithm Hash digest
SHA256 c6e14cb8c81e53695c8f4262e8de1d37124e38a3c5aa40fc5f311a226c6f6274
MD5 4bc158254580bdcfb09c98efe033d681
BLAKE2b-256 8ed54cca770345ad0e9bc009fe0aae26abf071121b2f61b24dbbca8b0d273319

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9c2b4e9f18423fcb9129cd487aafc79487f8104e595e69dd6e7fb3f81e946247
MD5 d58dc34e40322edc39869ae8ac270384
BLAKE2b-256 56cce57cb704e668863e04dd9d050f398768d6868e0ad04a4e91f529b32dcfaa

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8771015724f06fb7dd387e1e6ea765941bdc43b5ef4b6c52f1da05d75ca8f0d7
MD5 7e68d36ada09734531a7d4e8db7bb755
BLAKE2b-256 0ad8e3789c5269d9725e747bb6f6669befff535a33db33943c53ca1c7f8ea9a0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 75f6bb3a123dc1d9bc4f499752f12f8648f4fbdebe8aa9c848a31769eb711a85
MD5 fe3c3c5782743d02fa100b1fd02c9604
BLAKE2b-256 36ef5d4a0bdf52edf11e04750d1c71ed89731de5ff286dafc4372e091c3622cb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.2-cp313-cp313-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 33a730c45f3f7d9d3c104a01ee4c4be2c4592a8856959f669a757b7030041bc1
MD5 e23d2dd9c307336e447bd55d3d33d4fd
BLAKE2b-256 528ffccddccc5220984c8f3ab433d47c125ff338e98cf70b5e7577cc549a70db

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 cc66c82ce7f6520a89090a831c846315e192edb31700d09190b6e3155638228d
MD5 ca0ffeffc7bcaf49ce718fed249f57a1
BLAKE2b-256 cbb4e85a82cf61d763fccabfb20f0acb9796cb7b5320fed39d81e31761d445db

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 957ef9248551cf2ef8db064085d0732b340aca91069f833a41fcd428bfd0d8cd
MD5 a00508685956ba715f1d10357d93ebf6
BLAKE2b-256 5ff40ce5fadb7ea138e7d01a0cceb75123c7a9be008a6834665c899272686107

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 aaa3309b37b66450f7a5d2c36d9ee843d9a1927e86ee7e4826ca4dddbc00ea93
MD5 48c5e001c6f15242a59ae3982e732ff5
BLAKE2b-256 7bd4021821b41dc184919e20c35ba41f9e612a9f91d231049e6e2a85558d0c11

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.2-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 47482cce02577210225076902fd3b504f91e034bb392b679cc62f3bb2c0a6078
MD5 2d88e648516c9742fe1e5b802209808d
BLAKE2b-256 d8522325d5f521894d04bbae72a445ac86c0a2dbd5065122e969d011bd3157c1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 97af31905a2bac09eea492348682cae5b10b5b87e36ede4e77b2350045f10a78
MD5 8b1cf250d39deacd02a402b1be9037a6
BLAKE2b-256 39e9ffc5f71e69af4c6e4268b1aef2979ba89431b0ec70426a585b623799bc3c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 82bf96d33df168ebfd7f672a35f73be3247ba8a868bde8aa8334ecf3073150ec
MD5 5c073f3f421464f539a2293048872d14
BLAKE2b-256 2a8573f96a2cbe5d40bdef97f25a853c80cb51c1dfe8d8beb04d7f3e78d07dc8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b205686a521b5fc0834b63c0cd070a6935256a012f2ad5165dc403039c1b58da
MD5 4ee6436c25b2451c749e8080eb1ea28c
BLAKE2b-256 68ef3c2f223fc78d697187dd012c585867dfa3b0d86eb8d86905fa6c6150dfec

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.23.2-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 2c4565bb00be97d1c69aa160e38ffbf0bafc84ee4c9287afbb4ef07639d26f3d
MD5 aed523efaea2430d0b78a67f52779c08
BLAKE2b-256 88c734ec8088424cbb2a28de206b242560abbc5276d104c8a186bd4324fadb7f

See more details on using hashes here.

Provenance

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