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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.15+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.15+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

libraryfemtherm-0.22.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.22.1.tar.gz.

File metadata

  • Download URL: libraryfemtherm-0.22.1.tar.gz
  • Upload date:
  • Size: 490.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.22.1.tar.gz
Algorithm Hash digest
SHA256 97885d8f3d4e0dcce66ba0d34a2c2c262162f28a50ff842d0d613340a405b301
MD5 2141ff4775a3766b9296fcc7fe4f487f
BLAKE2b-256 1d0bbd28dcac45a859fea2214353d3a97a48a100dc0dadb282782d8a37c942b3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.22.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7828e02928625b8d666410aebf8d42be9fb05fd7d0e2e075da05dff39f97d818
MD5 4b4afbd5f42fb1894cfe124e7dfe3940
BLAKE2b-256 2b8c14617d40c6ca7f982fedd43e76d826fdec0496f5ead3f05ff6ff0f815362

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.22.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3c0e30774cc9006d141fe8708b8725875bd7d88402153600e8e3b394e6579818
MD5 74ba5f6070bcbba0b2041c1d6c7e25be
BLAKE2b-256 f250833bb033b6292bce414ebcb191bd544544005068ab1a8072951e88e879b4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.22.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 26cf63da3a8ef588fe18385ef567ca128c7e63c5325dc2922a663c7b34109890
MD5 4a17aab63662360fc114c538275275bf
BLAKE2b-256 2ef008542612b98af9d5e73208dfca563e58d3a81ec2b67814c563aa71f6fb71

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.22.1-cp313-cp313-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 201c4d609007263c46766c8c516bfb2f8cad6e604666dc373f9d37f597808975
MD5 2467d9208841750a4bab2433855e1d19
BLAKE2b-256 2c638fec5513a5ba4f455787ba7fdec485703718bb918b60e3efc67db64a367a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.22.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0f845c95b43581ae91e0afbffb8f836b85864878dc32453e091eb9f71205adaf
MD5 2c79e5db319774bb0ba4a992d293c4fb
BLAKE2b-256 83f58ccbfb2645a73a05198fb4dc6d7022ca724c9dfcbdab303bf49e7d016f26

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.22.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f2e6b6e0f37122303a938b7d60b26105bfe01a96802872b9c2a8aa374ccc6e6e
MD5 76931eb8deb11d2b9e0fbb3e441ab414
BLAKE2b-256 34bcaa1c22f8aac89c4b39c7c988d8584998257770e574a6069081c72482882e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.22.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 80756dffcaa49661dc96b32a7cd765c646da6607d2c306a69dc2b4852f13edd0
MD5 4dabf57971eebd4cbbc909314e9b3c0e
BLAKE2b-256 f43212b31899cc3edbd7a1c5635d52d09b2d25709925a2241c48041c52c44ad9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.22.1-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 77191e2438a4d7e798182dbf92432bfb5eeb01039ec0056ba3e9ed9b3029d8a6
MD5 8ab40da082ea5b9d606a76ca006351ad
BLAKE2b-256 0a0cf6b8fead2c32ccfd53dc9f9fea102d70f4dd6629ae6690bb7f3cc78aa912

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.22.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c54ac137d14bbf5ac6b84b3c47520edd3e4d4d82d190d3d293f61185d183b08b
MD5 70c406014b311a3ac9cb7a3e5d26ba6a
BLAKE2b-256 936b2164e7aecf3062966327cd2ae84cdf68eb45b7cfd946373365606ab3d044

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.22.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7754ac989dd3611f58f1b0e280971746b8032652e5cca95409eca19162b90995
MD5 d938d1ac3004c659f18e51a40318476c
BLAKE2b-256 b120fbfd341abcdc217de0d5c66081b8de017eb042438e5c23d875da3792d83a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.22.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 62391145a1554b136c07342feb686be81e1973e00d3b298f1fc15358b7f3a1a0
MD5 84819663fdda15b435c8ace67a1e72ca
BLAKE2b-256 5c47b08f42b0cbc1a2a96ed5b2ffb4f829c19e682d114158a8cf2458e465d950

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.22.1-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 4f841d4d8b760385c6acc1d37ced41d6b93b5db22e848abd9770a677a22d451c
MD5 7e9dd9d0dd37cbcbcc99fb002d8ce24f
BLAKE2b-256 07c04102b5aa53cc40dbe19986a5cfc1cb7bb931a3d3fd896f9f98e9daa012a9

See more details on using hashes here.

Provenance

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