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.0.tar.gz (489.9 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.0-cp313-cp313-win_amd64.whl (2.5 MB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

libraryfemtherm-0.22.0-cp313-cp313-macosx_10_15_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.13macOS 10.15+ x86-64

libraryfemtherm-0.22.0-cp312-cp312-win_amd64.whl (2.5 MB view details)

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

libraryfemtherm-0.22.0-cp312-cp312-macosx_10_15_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12macOS 10.15+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

libraryfemtherm-0.22.0-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.22.0.tar.gz.

File metadata

  • Download URL: libraryfemtherm-0.22.0.tar.gz
  • Upload date:
  • Size: 489.9 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.0.tar.gz
Algorithm Hash digest
SHA256 b56e16f4e911fda360e1e1b032762c02c04aba1a9b0b43029a02fc783148c73d
MD5 5833a2116396b9246982e61a89b028cf
BLAKE2b-256 87f136e38e8ce0c30df1f83b4216692fa53bca16d0fba57bd45e9a21abacedf6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.22.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c9e26c8938404b87e7b11bb981cb26598fefe33b7d89ee6c461b36f44dc896d6
MD5 3af836f3e64f64eb7031018ab8f3c6e6
BLAKE2b-256 704637da0150adf932e1cf7b358a89cfe2243d950fba736390a046b667bd00f5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.22.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ac0e37f94af400844afdc50d45e60279d96348865ad66687365422aa20e6158e
MD5 494828da8b97eb0c2cea5ceb9b19ba8b
BLAKE2b-256 d08ad8306797282743d434c473825176ea02337e9bd8a4cc9a69c0b11920c3e2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.22.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 62ae8e46132a2ab96e417e55c73436a4a23795cba1c6464779766e09de30bb06
MD5 129d68779fe5ee78aa083c54c232a75e
BLAKE2b-256 ccd1acff977264b6f80c55c9124a6a1febd210a5f320b84e4b479067d4f9b2da

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.22.0-cp313-cp313-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 3b3ef254cc2f1ba9941ee0ad14789fc2608fe48ce05cf532cadbe9b92fff674a
MD5 0483503e268fa66d31c61a3655f819b3
BLAKE2b-256 9545ba306c20c7dcef0251748a1de43a7f8690165e1af1e48d198b48465ab7b0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.22.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 17a3af1a2a837246eb4dda135a52b514ddb4767d55abb438d86bcc50f043a2a2
MD5 5ba003125eb19dfacf7cd5a67c795223
BLAKE2b-256 8e5a4d3b0f71e6b1a93f3b5554405a501ebc4361dcc28060e539fd0961daf7f6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.22.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7e18573371f33ba239d089b844e6409543f33177eb2808226c3a4bed947c5166
MD5 964ea075a69a63ced2a1ad53961987a2
BLAKE2b-256 95ec44b0e9770c24934836244715d0f2d04c685c8e15a671cf5aa90e96319476

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.22.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d706c19d546946f250308ea0bc71126e6d838b751f0fccdebf5727eb79ad86dd
MD5 1724df95a349b9ba9383993778a2ce0d
BLAKE2b-256 0bd97c0ba634c3fc77d97a90a6781940810e4cbd5dd944a4aebb234f396809ff

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.22.0-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 372deed54515f6436035bc3f4e55909d0d89e90bf335c1c8669ce65af3e404e0
MD5 617208b0d1b72a557225c3ce4955587d
BLAKE2b-256 9f67d042937e4dc639ca63eaa66e1b2603049b3a613f1acd76eba094aafbeccb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.22.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 589cd4a03553f551fa18e37af7b74187b9e199c11b12b24a03604302d6bd3a1f
MD5 851c4cd13c292140940823d4d549c31a
BLAKE2b-256 5fd1118087b46aeca5b863feaa6d6c0bc3f414fb2ed7bfaa596036ffd59c33e0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.22.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0e03fb566b5b2fbffb44cec85128688390ac4952e0855f5d686e41272c0c092f
MD5 d9bdfbe7965412540d9cfd555259e87c
BLAKE2b-256 690b78e3663cfd45555175a481614ea83683cd7016b352ea8f071981b8e62c62

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.22.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9bcdb489aa2b5dbbc0d6219c22b8bed533eaa6ebc92b1226fe93af776deb8335
MD5 f9bb20f444d9bd709640fc05500d4a70
BLAKE2b-256 af9698fb6515c3b8e140309f54b58e82763c7ba9eb5aae44dadbbee86f227aa6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for libraryfemtherm-0.22.0-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 5c63a23889d331886d102357a8de6fd128cc9425a3f0605aa8c52d8a7bd0618b
MD5 2d7828f32db90f86c3a153bdc61fb3f8
BLAKE2b-256 8fd085a0f44bd5c6588d9b61217741b9ae2c1fae758b25920650956220f1288f

See more details on using hashes here.

Provenance

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