ovfmi 0.3.3__py3-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ovfmi/__init__.py +30 -0
- ovfmi/_fmpy_runtime.py +454 -0
- ovfmi/_native_licenses/aes-0.9.2/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/aes-0.9.2/LICENSE-MIT +26 -0
- ovfmi/_native_licenses/approx-0.5.1/LICENSE +202 -0
- ovfmi/_native_licenses/askama-0.16.0/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/askama-0.16.0/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/askama_derive-0.16.0/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/askama_derive-0.16.0/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/askama_macros-0.16.0/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/askama_macros-0.16.0/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/askama_parser-0.16.0/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/askama_parser-0.16.0/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/askama_parser-0.16.0/benches/librustdoc/LICENSE.md +7 -0
- ovfmi/_native_licenses/autocfg-1.5.1/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/autocfg-1.5.1/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/basic-toml-0.1.10/LICENSE-APACHE +176 -0
- ovfmi/_native_licenses/basic-toml-0.1.10/LICENSE-MIT +23 -0
- ovfmi/_native_licenses/block-buffer-0.12.1/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/block-buffer-0.12.1/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/bumpalo-3.20.3/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/bumpalo-3.20.3/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/bzip2-0.6.1/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/bzip2-0.6.1/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/cc-1.11.2/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/cc-1.11.2/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/cfg-if-1.0.4/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/cfg-if-1.0.4/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/cipher-0.5.2/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/cipher-0.5.2/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/cmov-0.5.4/LICENSE-APACHE +202 -0
- ovfmi/_native_licenses/cmov-0.5.4/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/colored-3.1.1/LICENSE +373 -0
- ovfmi/_native_licenses/const-oid-0.10.2/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/const-oid-0.10.2/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/constant_time_eq-0.6.1/LICENSE-APACHE +176 -0
- ovfmi/_native_licenses/constant_time_eq-0.6.1/LICENSE-CC0 +121 -0
- ovfmi/_native_licenses/constant_time_eq-0.6.1/LICENSE-MIT0 +14 -0
- ovfmi/_native_licenses/cpubits-0.1.1/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/cpubits-0.1.1/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/cpufeatures-0.3.0/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/cpufeatures-0.3.0/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/crc32fast-1.5.0/LICENSE-APACHE +202 -0
- ovfmi/_native_licenses/crc32fast-1.5.0/LICENSE-MIT +21 -0
- ovfmi/_native_licenses/crypto-common-0.2.2/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/crypto-common-0.2.2/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/csv-1.4.0/COPYING +3 -0
- ovfmi/_native_licenses/csv-1.4.0/LICENSE-MIT +21 -0
- ovfmi/_native_licenses/csv-1.4.0/UNLICENSE +24 -0
- ovfmi/_native_licenses/csv-core-0.1.13/COPYING +3 -0
- ovfmi/_native_licenses/csv-core-0.1.13/LICENSE-MIT +21 -0
- ovfmi/_native_licenses/csv-core-0.1.13/UNLICENSE +24 -0
- ovfmi/_native_licenses/ctutils-0.4.2/LICENSE-APACHE +202 -0
- ovfmi/_native_licenses/ctutils-0.4.2/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/deflate64-0.1.12/LICENSE +24 -0
- ovfmi/_native_licenses/deranged-0.5.8/LICENSE-Apache +202 -0
- ovfmi/_native_licenses/deranged-0.5.8/LICENSE-MIT +19 -0
- ovfmi/_native_licenses/digest-0.11.3/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/digest-0.11.3/LICENSE-MIT +26 -0
- ovfmi/_native_licenses/displaydoc-0.2.7/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/displaydoc-0.2.7/LICENSE-MIT +23 -0
- ovfmi/_native_licenses/either-1.19.0/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/either-1.19.0/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/equivalent-1.0.2/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/equivalent-1.0.2/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/fastrand-2.5.0/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/fastrand-2.5.0/LICENSE-MIT +23 -0
- ovfmi/_native_licenses/find-msvc-tools-0.1.15/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/find-msvc-tools-0.1.15/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/flate2-1.1.9/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/flate2-1.1.9/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/fmi-rs-0.3.5/LICENSE +24 -0
- ovfmi/_native_licenses/fmi-rs-macros-0.3.5/LICENSE +24 -0
- ovfmi/_native_licenses/form_urlencoded-1.2.2/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/form_urlencoded-1.2.2/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/getrandom-0.4.3/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/getrandom-0.4.3/LICENSE-MIT +26 -0
- ovfmi/_native_licenses/glob-0.3.4/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/glob-0.3.4/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/hashbrown-0.17.1/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/hashbrown-0.17.1/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/heck-0.5.0/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/heck-0.5.0/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/hmac-0.13.0/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/hmac-0.13.0/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/hybrid-array-0.4.14/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/hybrid-array-0.4.14/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/icu_collections-2.2.0/LICENSE +46 -0
- ovfmi/_native_licenses/icu_locale_core-2.2.0/LICENSE +46 -0
- ovfmi/_native_licenses/icu_normalizer-2.2.0/LICENSE +46 -0
- ovfmi/_native_licenses/icu_normalizer_data-2.2.0/LICENSE +46 -0
- ovfmi/_native_licenses/icu_properties-2.2.0/LICENSE +46 -0
- ovfmi/_native_licenses/icu_properties_data-2.2.0/LICENSE +46 -0
- ovfmi/_native_licenses/icu_provider-2.2.0/LICENSE +46 -0
- ovfmi/_native_licenses/idna-1.1.0/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/idna-1.1.0/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/idna_adapter-1.2.2/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/idna_adapter-1.2.2/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/indexmap-2.14.0/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/indexmap-2.14.0/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/inout-0.2.2/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/inout-0.2.2/LICENSE-MIT +26 -0
- ovfmi/_native_licenses/itertools-0.15.0/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/itertools-0.15.0/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/itoa-1.0.18/LICENSE-APACHE +176 -0
- ovfmi/_native_licenses/itoa-1.0.18/LICENSE-MIT +23 -0
- ovfmi/_native_licenses/jobserver-0.1.35/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/jobserver-0.1.35/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/libbz2-rs-sys-0.2.5/LICENSE +48 -0
- ovfmi/_native_licenses/libc-0.2.189/LICENSE-APACHE +176 -0
- ovfmi/_native_licenses/libc-0.2.189/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/libloading-0.9.0/LICENSE +12 -0
- ovfmi/_native_licenses/litemap-0.8.2/LICENSE +46 -0
- ovfmi/_native_licenses/log-0.4.33/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/log-0.4.33/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/lzma-rust2-0.25.0/LICENSE +201 -0
- ovfmi/_native_licenses/memchr-2.8.3/COPYING +3 -0
- ovfmi/_native_licenses/memchr-2.8.3/LICENSE-MIT +21 -0
- ovfmi/_native_licenses/memchr-2.8.3/UNLICENSE +24 -0
- ovfmi/_native_licenses/num-conv-0.2.2/LICENSE-Apache +177 -0
- ovfmi/_native_licenses/num-conv-0.2.2/LICENSE-MIT +19 -0
- ovfmi/_native_licenses/num-traits-0.2.19/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/num-traits-0.2.19/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/once_cell-1.21.4/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/once_cell-1.21.4/LICENSE-MIT +23 -0
- ovfmi/_native_licenses/packages.json +1973 -0
- ovfmi/_native_licenses/pbkdf2-0.13.0/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/pbkdf2-0.13.0/LICENSE-MIT +26 -0
- ovfmi/_native_licenses/percent-encoding-2.3.2/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/percent-encoding-2.3.2/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/pkg-config-0.3.33/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/pkg-config-0.3.33/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/potential_utf-0.1.5/LICENSE +46 -0
- ovfmi/_native_licenses/powerfmt-0.2.0/LICENSE-Apache +202 -0
- ovfmi/_native_licenses/powerfmt-0.2.0/LICENSE-MIT +19 -0
- ovfmi/_native_licenses/ppmd-rust-1.5.2/LICENSE-CC0.md +119 -0
- ovfmi/_native_licenses/ppmd-rust-1.5.2/LICENSE-MIT-0.md +16 -0
- ovfmi/_native_licenses/proc-macro2-1.0.107/LICENSE-APACHE +176 -0
- ovfmi/_native_licenses/proc-macro2-1.0.107/LICENSE-MIT +23 -0
- ovfmi/_native_licenses/quick-xml-0.42.0/LICENSE-MIT.md +23 -0
- ovfmi/_native_licenses/quote-1.0.47/LICENSE-APACHE +176 -0
- ovfmi/_native_licenses/quote-1.0.47/LICENSE-MIT +23 -0
- ovfmi/_native_licenses/roxmltree-0.21.1/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/roxmltree-0.21.1/LICENSE-MIT +21 -0
- ovfmi/_native_licenses/rust-standard-library/COPYRIGHT-library.html +5556 -0
- ovfmi/_native_licenses/rust-standard-library/licenses/Apache-2.0.txt +73 -0
- ovfmi/_native_licenses/rust-standard-library/licenses/BSD-2-Clause.txt +9 -0
- ovfmi/_native_licenses/rust-standard-library/licenses/CC-BY-SA-4.0.txt +427 -0
- ovfmi/_native_licenses/rust-standard-library/licenses/GCC-exception-3.1.txt +30 -0
- ovfmi/_native_licenses/rust-standard-library/licenses/GPL-2.0-only.txt +133 -0
- ovfmi/_native_licenses/rust-standard-library/licenses/GPL-3.0-or-later.txt +202 -0
- ovfmi/_native_licenses/rust-standard-library/licenses/ISC.txt +7 -0
- ovfmi/_native_licenses/rust-standard-library/licenses/LLVM-exception.txt +15 -0
- ovfmi/_native_licenses/rust-standard-library/licenses/MIT.txt +9 -0
- ovfmi/_native_licenses/rust-standard-library/licenses/NCSA.txt +29 -0
- ovfmi/_native_licenses/rust-standard-library/licenses/OFL-1.1.txt +43 -0
- ovfmi/_native_licenses/rust-standard-library/licenses/Unicode-3.0.txt +39 -0
- ovfmi/_native_licenses/rustc-hash-2.1.3/LICENSE-APACHE +176 -0
- ovfmi/_native_licenses/rustc-hash-2.1.3/LICENSE-MIT +23 -0
- ovfmi/_native_licenses/rustversion-1.0.23/LICENSE-APACHE +176 -0
- ovfmi/_native_licenses/rustversion-1.0.23/LICENSE-MIT +23 -0
- ovfmi/_native_licenses/ryu-1.0.23/LICENSE-APACHE +176 -0
- ovfmi/_native_licenses/ryu-1.0.23/LICENSE-BOOST +23 -0
- ovfmi/_native_licenses/serde-1.0.229/LICENSE-APACHE +176 -0
- ovfmi/_native_licenses/serde-1.0.229/LICENSE-MIT +23 -0
- ovfmi/_native_licenses/serde_core-1.0.229/LICENSE-APACHE +176 -0
- ovfmi/_native_licenses/serde_core-1.0.229/LICENSE-MIT +23 -0
- ovfmi/_native_licenses/serde_derive-1.0.229/LICENSE-APACHE +176 -0
- ovfmi/_native_licenses/serde_derive-1.0.229/LICENSE-MIT +23 -0
- ovfmi/_native_licenses/serde_json-1.0.151/LICENSE-APACHE +176 -0
- ovfmi/_native_licenses/serde_json-1.0.151/LICENSE-MIT +23 -0
- ovfmi/_native_licenses/sha1-0.11.0/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/sha1-0.11.0/LICENSE-MIT +28 -0
- ovfmi/_native_licenses/sha2-0.11.0/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/sha2-0.11.0/LICENSE-MIT +28 -0
- ovfmi/_native_licenses/shlex-2.0.1/LICENSE-APACHE +13 -0
- ovfmi/_native_licenses/shlex-2.0.1/LICENSE-MIT +21 -0
- ovfmi/_native_licenses/simd-adler32-0.3.10/LICENSE.md +21 -0
- ovfmi/_native_licenses/smallvec-1.15.2/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/smallvec-1.15.2/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/stable_deref_trait-1.2.1/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/stable_deref_trait-1.2.1/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/strum-0.28.0/LICENSE +21 -0
- ovfmi/_native_licenses/strum_macros-0.28.0/LICENSE +21 -0
- ovfmi/_native_licenses/syn-2.0.119/LICENSE-APACHE +176 -0
- ovfmi/_native_licenses/syn-2.0.119/LICENSE-MIT +23 -0
- ovfmi/_native_licenses/syn-3.0.3/LICENSE-APACHE +176 -0
- ovfmi/_native_licenses/syn-3.0.3/LICENSE-MIT +23 -0
- ovfmi/_native_licenses/synstructure-0.13.2/LICENSE +7 -0
- ovfmi/_native_licenses/tempfile-3.27.0/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/tempfile-3.27.0/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/thiserror-2.0.20/LICENSE-APACHE +176 -0
- ovfmi/_native_licenses/thiserror-2.0.20/LICENSE-MIT +23 -0
- ovfmi/_native_licenses/thiserror-impl-2.0.20/LICENSE-APACHE +176 -0
- ovfmi/_native_licenses/thiserror-impl-2.0.20/LICENSE-MIT +23 -0
- ovfmi/_native_licenses/time-0.3.55/LICENSE-Apache +177 -0
- ovfmi/_native_licenses/time-0.3.55/LICENSE-MIT +19 -0
- ovfmi/_native_licenses/time-core-0.1.9/LICENSE-Apache +177 -0
- ovfmi/_native_licenses/time-core-0.1.9/LICENSE-MIT +19 -0
- ovfmi/_native_licenses/tinystr-0.8.3/LICENSE +46 -0
- ovfmi/_native_licenses/typed-path-0.13.0/LICENSE-APACHE +176 -0
- ovfmi/_native_licenses/typed-path-0.13.0/LICENSE-MIT +23 -0
- ovfmi/_native_licenses/typenum-1.20.1/LICENSE +1 -0
- ovfmi/_native_licenses/typenum-1.20.1/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/typenum-1.20.1/LICENSE-MIT +21 -0
- ovfmi/_native_licenses/unicode-ident-1.0.24/LICENSE-APACHE +176 -0
- ovfmi/_native_licenses/unicode-ident-1.0.24/LICENSE-MIT +23 -0
- ovfmi/_native_licenses/unicode-ident-1.0.24/LICENSE-UNICODE +39 -0
- ovfmi/_native_licenses/url-2.5.8/LICENSE-APACHE +201 -0
- ovfmi/_native_licenses/url-2.5.8/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/utf8_iter-1.0.4/COPYRIGHT +42 -0
- ovfmi/_native_licenses/utf8_iter-1.0.4/LICENSE-APACHE +202 -0
- ovfmi/_native_licenses/utf8_iter-1.0.4/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/windows-link-0.2.1/license-apache-2.0 +201 -0
- ovfmi/_native_licenses/windows-link-0.2.1/license-mit +21 -0
- ovfmi/_native_licenses/windows-sys-0.61.2/license-apache-2.0 +201 -0
- ovfmi/_native_licenses/windows-sys-0.61.2/license-mit +21 -0
- ovfmi/_native_licenses/winnow-1.0.4/LICENSE-MIT +18 -0
- ovfmi/_native_licenses/writeable-0.6.3/LICENSE +46 -0
- ovfmi/_native_licenses/yoke-0.8.3/LICENSE +46 -0
- ovfmi/_native_licenses/yoke-derive-0.8.2/LICENSE +46 -0
- ovfmi/_native_licenses/zerofrom-0.1.8/LICENSE +46 -0
- ovfmi/_native_licenses/zerofrom-derive-0.1.7/LICENSE +46 -0
- ovfmi/_native_licenses/zeroize-1.9.0/LICENSE-APACHE +202 -0
- ovfmi/_native_licenses/zeroize-1.9.0/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/zeroize_derive-1.5.0/LICENSE-APACHE +202 -0
- ovfmi/_native_licenses/zeroize_derive-1.5.0/LICENSE-MIT +25 -0
- ovfmi/_native_licenses/zerotrie-0.2.4/LICENSE +46 -0
- ovfmi/_native_licenses/zerovec-0.11.6/LICENSE +46 -0
- ovfmi/_native_licenses/zerovec-derive-0.11.3/LICENSE +46 -0
- ovfmi/_native_licenses/zip-9.6.1/LICENSE +21 -0
- ovfmi/_native_licenses/zlib-rs-0.6.7/LICENSE +19 -0
- ovfmi/_native_licenses/zmij-1.0.23/LICENSE-MIT +23 -0
- ovfmi/_native_licenses/zopfli-0.8.3/COPYING +201 -0
- ovfmi/_native_licenses/zstd-0.14.4/LICENSE +28 -0
- ovfmi/_native_licenses/zstd-safe-8.3.0/LICENSE +28 -0
- ovfmi/_native_licenses/zstd-sys-2.1.3+zstd.1.5.7/LICENSE +28 -0
- ovfmi/_native_licenses/zstd-sys-2.1.3+zstd.1.5.7/LICENSE.BSD-2-Clause +29 -0
- ovfmi/_native_licenses/zstd-sys-2.1.3+zstd.1.5.7/LICENSE.BSD-3-Clause +32 -0
- ovfmi/_native_licenses/zstd-sys-2.1.3+zstd.1.5.7/zstd/COPYING +339 -0
- ovfmi/_native_licenses/zstd-sys-2.1.3+zstd.1.5.7/zstd/LICENSE +30 -0
- ovfmi/_native_runtime.py +166 -0
- ovfmi/_parse_fmi_schema.py +409 -0
- ovfmi/_parser.py +35 -0
- ovfmi/_ssp_runtime.py +444 -0
- ovfmi/api.py +337 -0
- ovfmi/backend.py +60 -0
- ovfmi/ovfmi_native.dll +0 -0
- ovfmi/population.py +101 -0
- ovfmi/routing.py +435 -0
- ovfmi/types.py +159 -0
- ovfmi-0.3.3.dist-info/METADATA +164 -0
- ovfmi-0.3.3.dist-info/RECORD +257 -0
- ovfmi-0.3.3.dist-info/WHEEL +5 -0
- ovfmi-0.3.3.dist-info/licenses/LICENSE.md +204 -0
- ovfmi-0.3.3.dist-info/licenses/THIRD_PARTY_NOTICES.md +248 -0
- ovfmi-0.3.3.dist-info/top_level.txt +1 -0
ovfmi/__init__.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Supported Python API for USD-authored FMI co-simulation.
|
|
5
|
+
|
|
6
|
+
Only the names exported here are part of ovfmi's compatibility contract.
|
|
7
|
+
Package submodules are implementation details and may change without notice.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from .api import FmiHost
|
|
11
|
+
from .types import (
|
|
12
|
+
AttributeWrite,
|
|
13
|
+
FmiHostConfig,
|
|
14
|
+
InstanceInfo,
|
|
15
|
+
MissingInputPolicy,
|
|
16
|
+
PopulationReport,
|
|
17
|
+
ReadGroup,
|
|
18
|
+
ReadResult,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
__all__ = [
|
|
22
|
+
"AttributeWrite",
|
|
23
|
+
"FmiHost",
|
|
24
|
+
"FmiHostConfig",
|
|
25
|
+
"InstanceInfo",
|
|
26
|
+
"MissingInputPolicy",
|
|
27
|
+
"PopulationReport",
|
|
28
|
+
"ReadGroup",
|
|
29
|
+
"ReadResult",
|
|
30
|
+
]
|
ovfmi/_fmpy_runtime.py
ADDED
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
# Adapted from usd_fmi (omni/source/extensions/fmi/source/fmi.usd.runtime)
|
|
2
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
4
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
#
|
|
6
|
+
# Change from upstream: import from local fmi_parser instead of fmi.usd.parser package.
|
|
7
|
+
|
|
8
|
+
from ._parser import FmuParserInstance
|
|
9
|
+
import fmpy
|
|
10
|
+
import os
|
|
11
|
+
import tempfile
|
|
12
|
+
import sys
|
|
13
|
+
from fmpy.fmi1 import FMU1Slave, FMU1Model
|
|
14
|
+
from fmpy.fmi2 import FMU2Slave, FMU2Model
|
|
15
|
+
from fmpy.fmi3 import FMU3Slave, FMU3Model, FMU3ScheduledExecution
|
|
16
|
+
from fmpy.model_description import ModelDescription, ScalarVariable
|
|
17
|
+
from fmpy.simulation import SimulationResult
|
|
18
|
+
import shutil
|
|
19
|
+
import copy
|
|
20
|
+
from pathlib import Path
|
|
21
|
+
|
|
22
|
+
FMPYType = FMU1Slave | FMU2Slave | FMU3Slave | FMU1Model | FMU2Model | FMU3Model | FMU3ScheduledExecution
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def fmpy_resolve_model_description_shapes(model_description: ModelDescription, fmu_instance: FMPYType):
|
|
26
|
+
resolved_variables: dict[int, tuple[ScalarVariable, int]] = {}
|
|
27
|
+
for variable in model_description.modelVariables:
|
|
28
|
+
if variable.shape is not None:
|
|
29
|
+
for index, dimension in enumerate(variable.dimensions):
|
|
30
|
+
if dimension.valueReference is not None:
|
|
31
|
+
if dimension.valueReference in resolved_variables:
|
|
32
|
+
_, resolved_value = resolved_variables[dimension.valueReference]
|
|
33
|
+
else:
|
|
34
|
+
refVariable = next(
|
|
35
|
+
(v for v in model_description.modelVariables
|
|
36
|
+
if v.valueReference == dimension.valueReference),
|
|
37
|
+
None,
|
|
38
|
+
)
|
|
39
|
+
if refVariable is None:
|
|
40
|
+
raise Exception(f"Variable {refVariable.name} not found in model description")
|
|
41
|
+
type = refVariable.type
|
|
42
|
+
getter = getattr(fmu_instance, "get" + type)
|
|
43
|
+
resolved_value = getter(vr=[refVariable.valueReference], nValues=1)[0]
|
|
44
|
+
resolved_variables[refVariable.valueReference] = (refVariable, resolved_value)
|
|
45
|
+
shape = list(variable.shape)
|
|
46
|
+
shape[index] = int(resolved_value)
|
|
47
|
+
variable.shape = tuple(shape)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class FmuRuntimeInstance:
|
|
51
|
+
def __init__(self, parser_instance: FmuParserInstance, model_description: ModelDescription, fmu_instance: FMPYType):
|
|
52
|
+
self._parser_instance = parser_instance
|
|
53
|
+
self._model_description = copy.deepcopy(model_description)
|
|
54
|
+
self._fmu_instance = fmu_instance
|
|
55
|
+
self._must_terminate = False
|
|
56
|
+
self._last_successful_time = 0
|
|
57
|
+
self._prev_time = 0
|
|
58
|
+
self._prev_results = []
|
|
59
|
+
self._start_values = {}
|
|
60
|
+
self._structural_parameters = {}
|
|
61
|
+
|
|
62
|
+
def get_parser_instance(self) -> FmuParserInstance:
|
|
63
|
+
return self._parser_instance
|
|
64
|
+
|
|
65
|
+
def get_model_description(self) -> ModelDescription:
|
|
66
|
+
return self._model_description
|
|
67
|
+
|
|
68
|
+
def get_fmu_instance(self) -> FMPYType:
|
|
69
|
+
return self._fmu_instance
|
|
70
|
+
|
|
71
|
+
def set_start_values(self, start_values: dict):
|
|
72
|
+
self._start_values = start_values
|
|
73
|
+
|
|
74
|
+
def destroy(self):
|
|
75
|
+
if self._fmu_instance is not None:
|
|
76
|
+
try:
|
|
77
|
+
if self._must_terminate:
|
|
78
|
+
self._fmu_instance.terminate()
|
|
79
|
+
except Exception as e:
|
|
80
|
+
print(e)
|
|
81
|
+
finally:
|
|
82
|
+
self._fmu_instance.freeInstance()
|
|
83
|
+
self._fmu_instance = None
|
|
84
|
+
self._must_terminate = False
|
|
85
|
+
|
|
86
|
+
@staticmethod
|
|
87
|
+
def find_result_earlier_than(time: float, results: SimulationResult) -> int:
|
|
88
|
+
if len(results) == 0:
|
|
89
|
+
return None
|
|
90
|
+
idx = -1
|
|
91
|
+
for result in results:
|
|
92
|
+
idx = idx + 1
|
|
93
|
+
if result[0] > time:
|
|
94
|
+
idx = idx - 1
|
|
95
|
+
break
|
|
96
|
+
if idx == -1:
|
|
97
|
+
return 0
|
|
98
|
+
return idx
|
|
99
|
+
|
|
100
|
+
def reset(self):
|
|
101
|
+
self._prev_results = []
|
|
102
|
+
self._prev_time = 0
|
|
103
|
+
self._structural_parameters = {}
|
|
104
|
+
self._last_successful_time = 0
|
|
105
|
+
self._fmu_instance.reset()
|
|
106
|
+
self._must_terminate = False
|
|
107
|
+
|
|
108
|
+
def resume(self):
|
|
109
|
+
pass
|
|
110
|
+
|
|
111
|
+
def _set_variable_values(self, variable: ScalarVariable, values):
|
|
112
|
+
if not isinstance(values, list):
|
|
113
|
+
values = [values]
|
|
114
|
+
if variable.type == "Float32":
|
|
115
|
+
self._fmu_instance.setFloat32([variable.valueReference], values)
|
|
116
|
+
elif variable.type in ("Float64", "Real"):
|
|
117
|
+
setter = getattr(self._fmu_instance, "setFloat64", None)
|
|
118
|
+
if setter is None:
|
|
119
|
+
setter = getattr(self._fmu_instance, "setReal")
|
|
120
|
+
setter([variable.valueReference], values)
|
|
121
|
+
elif variable.type in ("Int32", "Integer"):
|
|
122
|
+
setter = getattr(self._fmu_instance, "setInt32", None)
|
|
123
|
+
if setter is None:
|
|
124
|
+
setter = getattr(self._fmu_instance, "setInteger")
|
|
125
|
+
setter([variable.valueReference], values)
|
|
126
|
+
elif variable.type == "UInt32":
|
|
127
|
+
self._fmu_instance.setUInt32([variable.valueReference], values)
|
|
128
|
+
elif variable.type == "Boolean":
|
|
129
|
+
bool_values = [bool(v) for v in values]
|
|
130
|
+
self._fmu_instance.setBoolean([variable.valueReference], bool_values)
|
|
131
|
+
|
|
132
|
+
def step(self, filename: str, inputs, outputs: list, time: float):
|
|
133
|
+
if self._prev_time > time:
|
|
134
|
+
self._prev_results = []
|
|
135
|
+
self._last_successful_time = 0
|
|
136
|
+
self._fmu_instance.reset()
|
|
137
|
+
self._must_terminate = False
|
|
138
|
+
self._prev_time = time
|
|
139
|
+
|
|
140
|
+
if time - self._last_successful_time == 0:
|
|
141
|
+
return
|
|
142
|
+
|
|
143
|
+
if len(self._prev_results):
|
|
144
|
+
result_idx = self.find_result_earlier_than(time, self._prev_results)
|
|
145
|
+
if result_idx is not None:
|
|
146
|
+
result = self._prev_results[result_idx]
|
|
147
|
+
self._prev_results = self._prev_results[result_idx + 1:]
|
|
148
|
+
return result
|
|
149
|
+
|
|
150
|
+
if self._last_successful_time == 0:
|
|
151
|
+
# Inputs can change after attach (or reset) but before the first
|
|
152
|
+
# step. Initialize from that current snapshot, retaining authored
|
|
153
|
+
# defaults for anything not supplied. Do not overwrite the cached
|
|
154
|
+
# start values: reset must still restore the authored state.
|
|
155
|
+
start_values = {**self._start_values, **inputs}
|
|
156
|
+
for variable in self._model_description.modelVariables:
|
|
157
|
+
value = start_values.get(variable.name)
|
|
158
|
+
if not variable.dimensions and isinstance(value, list):
|
|
159
|
+
if len(value) != 1:
|
|
160
|
+
raise ValueError(f"Scalar FMI variable '{variable.name}' requires exactly one value")
|
|
161
|
+
start_values[variable.name] = value[0]
|
|
162
|
+
if (
|
|
163
|
+
variable.causality == "parameter"
|
|
164
|
+
and variable.variability == "fixed"
|
|
165
|
+
and variable.type == "String"
|
|
166
|
+
and variable.name in start_values
|
|
167
|
+
):
|
|
168
|
+
self._fmu_instance.setString([variable.valueReference], [start_values[variable.name]])
|
|
169
|
+
if variable.causality == "structuralParameter" and variable.name in start_values:
|
|
170
|
+
self._structural_parameters[variable.name] = start_values[variable.name]
|
|
171
|
+
self._fmu_instance.fmi3EnterConfigurationMode(self._fmu_instance.component)
|
|
172
|
+
self._fmu_instance.setUInt32([variable.valueReference], [start_values[variable.name]])
|
|
173
|
+
self._fmu_instance.fmi3ExitConfigurationMode(self._fmu_instance.component)
|
|
174
|
+
|
|
175
|
+
fmpy_resolve_model_description_shapes(self._model_description, self._fmu_instance)
|
|
176
|
+
|
|
177
|
+
results = fmpy.simulate_fmu(
|
|
178
|
+
filename=filename,
|
|
179
|
+
fmi_type="CoSimulation",
|
|
180
|
+
model_description=self._model_description,
|
|
181
|
+
fmu_instance=self._fmu_instance,
|
|
182
|
+
start_values=start_values,
|
|
183
|
+
output=outputs,
|
|
184
|
+
stop_time=time,
|
|
185
|
+
set_stop_time=False,
|
|
186
|
+
terminate=False,
|
|
187
|
+
fmi_call_logger=lambda s: print("[FMI] " + s),
|
|
188
|
+
)
|
|
189
|
+
else:
|
|
190
|
+
needs_configuration_mode = False
|
|
191
|
+
for variable in self._model_description.modelVariables:
|
|
192
|
+
if variable.causality == "structuralParameter" and variable.name in inputs:
|
|
193
|
+
if (variable.name not in self._structural_parameters
|
|
194
|
+
or self._structural_parameters[variable.name] != inputs[variable.name]):
|
|
195
|
+
self._structural_parameters[variable.name] = inputs[variable.name]
|
|
196
|
+
needs_configuration_mode = True
|
|
197
|
+
|
|
198
|
+
if needs_configuration_mode:
|
|
199
|
+
self._fmu_instance.fmi3EnterConfigurationMode(self._fmu_instance.component)
|
|
200
|
+
|
|
201
|
+
try:
|
|
202
|
+
for variable in self._model_description.modelVariables:
|
|
203
|
+
if not variable.name in inputs:
|
|
204
|
+
continue
|
|
205
|
+
if variable.variability == "fixed":
|
|
206
|
+
continue
|
|
207
|
+
if variable.causality == "output":
|
|
208
|
+
continue
|
|
209
|
+
if not needs_configuration_mode and variable.causality == "structuralParameter":
|
|
210
|
+
continue
|
|
211
|
+
self._set_variable_values(variable, inputs[variable.name])
|
|
212
|
+
finally:
|
|
213
|
+
if needs_configuration_mode:
|
|
214
|
+
self._fmu_instance.fmi3ExitConfigurationMode(self._fmu_instance.component)
|
|
215
|
+
|
|
216
|
+
results = fmpy.simulate_fmu(
|
|
217
|
+
filename=filename,
|
|
218
|
+
fmi_type="CoSimulation",
|
|
219
|
+
model_description=self._model_description,
|
|
220
|
+
fmu_instance=self._fmu_instance,
|
|
221
|
+
start_time=self._last_successful_time,
|
|
222
|
+
stop_time=time,
|
|
223
|
+
set_stop_time=False,
|
|
224
|
+
initialize=False,
|
|
225
|
+
terminate=False,
|
|
226
|
+
output=outputs,
|
|
227
|
+
fmi_call_logger=lambda s: print("[FMI] " + s),
|
|
228
|
+
)
|
|
229
|
+
|
|
230
|
+
self._must_terminate = True
|
|
231
|
+
if len(results) > 0:
|
|
232
|
+
self._last_successful_time = results[-1][0]
|
|
233
|
+
result_idx = self.find_result_earlier_than(time, results)
|
|
234
|
+
if result_idx is not None:
|
|
235
|
+
result = results[result_idx]
|
|
236
|
+
self._prev_results = results[result_idx + 1:]
|
|
237
|
+
return result
|
|
238
|
+
else:
|
|
239
|
+
self._last_successful_time = time
|
|
240
|
+
return None
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
class FmuRuntimeExtractedFMU:
|
|
244
|
+
def __init__(self, fmu_location: str):
|
|
245
|
+
self._runtime_fmus: list[FmuRuntimeInstance] = []
|
|
246
|
+
self._unzip_dir = None
|
|
247
|
+
self._model_description = None
|
|
248
|
+
self._should_delete_unzip_directory = False
|
|
249
|
+
try:
|
|
250
|
+
self._unzip_fmu(fmu_location)
|
|
251
|
+
except BaseException:
|
|
252
|
+
self._remove_unzip_directory(ignore_errors=True)
|
|
253
|
+
raise
|
|
254
|
+
|
|
255
|
+
def get_runtime_instances(self) -> list[FmuRuntimeInstance]:
|
|
256
|
+
return self._runtime_fmus
|
|
257
|
+
|
|
258
|
+
def get_unzip_dir(self) -> str:
|
|
259
|
+
return self._unzip_dir
|
|
260
|
+
|
|
261
|
+
def destroy(self):
|
|
262
|
+
for instance in self._runtime_fmus:
|
|
263
|
+
instance.destroy()
|
|
264
|
+
self._runtime_fmus.clear()
|
|
265
|
+
self._remove_unzip_directory()
|
|
266
|
+
|
|
267
|
+
def _remove_unzip_directory(self, *, ignore_errors: bool = False):
|
|
268
|
+
try:
|
|
269
|
+
if self._should_delete_unzip_directory:
|
|
270
|
+
shutil.rmtree(self._unzip_dir, ignore_errors=ignore_errors)
|
|
271
|
+
finally:
|
|
272
|
+
self._should_delete_unzip_directory = False
|
|
273
|
+
self._unzip_dir = None
|
|
274
|
+
self._model_description = None
|
|
275
|
+
|
|
276
|
+
def _unzip_fmu(self, fmu_location: str):
|
|
277
|
+
self._fmu_location = fmu_location
|
|
278
|
+
if os.path.isdir(self._fmu_location):
|
|
279
|
+
self._unzip_dir = self._fmu_location
|
|
280
|
+
else:
|
|
281
|
+
self._unzip_dir = tempfile.mkdtemp()
|
|
282
|
+
self._should_delete_unzip_directory = True
|
|
283
|
+
if sys.platform.startswith("win") and "~" in self._unzip_dir:
|
|
284
|
+
import ntpath
|
|
285
|
+
self._unzip_dir = ntpath.realpath(self._unzip_dir)
|
|
286
|
+
fmpy.extract(filename=self._fmu_location, unzipdir=self._unzip_dir)
|
|
287
|
+
self._model_description = fmpy.read_model_description(filename=self._unzip_dir)
|
|
288
|
+
self._add_bundled_windows_binary_if_needed()
|
|
289
|
+
print(f"fmu guid={self._model_description.guid}")
|
|
290
|
+
print(f"fmu model={self._model_description.coSimulation.modelIdentifier}")
|
|
291
|
+
|
|
292
|
+
def _add_bundled_windows_binary_if_needed(self):
|
|
293
|
+
if not sys.platform.startswith("win"):
|
|
294
|
+
return
|
|
295
|
+
if self._model_description.coSimulation is None:
|
|
296
|
+
return
|
|
297
|
+
|
|
298
|
+
model_identifier = self._model_description.coSimulation.modelIdentifier
|
|
299
|
+
platform_dir = (
|
|
300
|
+
"win64"
|
|
301
|
+
if str(self._model_description.fmiVersion).startswith("2")
|
|
302
|
+
else "x86_64-windows"
|
|
303
|
+
)
|
|
304
|
+
expected = (
|
|
305
|
+
Path(self._unzip_dir)
|
|
306
|
+
/ "binaries"
|
|
307
|
+
/ platform_dir
|
|
308
|
+
/ f"{model_identifier}.dll"
|
|
309
|
+
)
|
|
310
|
+
if expected.exists():
|
|
311
|
+
return
|
|
312
|
+
|
|
313
|
+
staged = self._find_staged_windows_fmu_binary(model_identifier)
|
|
314
|
+
if staged is None:
|
|
315
|
+
return
|
|
316
|
+
|
|
317
|
+
if not self._should_delete_unzip_directory:
|
|
318
|
+
source_dir = self._unzip_dir
|
|
319
|
+
self._unzip_dir = tempfile.mkdtemp(prefix="ov_fmi_")
|
|
320
|
+
self._should_delete_unzip_directory = True
|
|
321
|
+
shutil.copytree(source_dir, self._unzip_dir, dirs_exist_ok=True)
|
|
322
|
+
target = (
|
|
323
|
+
Path(self._unzip_dir)
|
|
324
|
+
/ "binaries"
|
|
325
|
+
/ platform_dir
|
|
326
|
+
/ f"{model_identifier}.dll"
|
|
327
|
+
)
|
|
328
|
+
target.parent.mkdir(parents=True, exist_ok=True)
|
|
329
|
+
shutil.copy2(staged, target)
|
|
330
|
+
|
|
331
|
+
print(f"Using staged Windows FMU binary: {staged}")
|
|
332
|
+
|
|
333
|
+
def _find_staged_windows_fmu_binary(self, model_identifier: str) -> Path | None:
|
|
334
|
+
repo_root = Path(__file__).resolve().parent.parent
|
|
335
|
+
fmu_name = Path(self._fmu_location).name
|
|
336
|
+
candidates = []
|
|
337
|
+
for config in ("Release", "RelWithDebInfo", "Debug"):
|
|
338
|
+
candidates.append(
|
|
339
|
+
repo_root
|
|
340
|
+
/ "build"
|
|
341
|
+
/ config
|
|
342
|
+
/ "fmus"
|
|
343
|
+
/ fmu_name
|
|
344
|
+
/ "binaries"
|
|
345
|
+
/ "x86_64-windows"
|
|
346
|
+
/ f"{model_identifier}.dll"
|
|
347
|
+
)
|
|
348
|
+
candidates.append(
|
|
349
|
+
repo_root
|
|
350
|
+
/ "build"
|
|
351
|
+
/ config
|
|
352
|
+
/ "fmus"
|
|
353
|
+
/ fmu_name
|
|
354
|
+
/ "binaries"
|
|
355
|
+
/ "win64"
|
|
356
|
+
/ f"{model_identifier}.dll"
|
|
357
|
+
)
|
|
358
|
+
candidates.append(repo_root / "build" / config / f"{model_identifier}.dll")
|
|
359
|
+
|
|
360
|
+
for candidate in candidates:
|
|
361
|
+
if candidate.exists():
|
|
362
|
+
return candidate
|
|
363
|
+
return None
|
|
364
|
+
|
|
365
|
+
def add_instance(self, parser_instance: FmuParserInstance):
|
|
366
|
+
if not parser_instance.enabled:
|
|
367
|
+
return
|
|
368
|
+
fmu_instance = fmpy.instantiate_fmu(
|
|
369
|
+
unzipdir=self._unzip_dir, model_description=self._model_description
|
|
370
|
+
)
|
|
371
|
+
runtime_instance = FmuRuntimeInstance(
|
|
372
|
+
parser_instance=parser_instance,
|
|
373
|
+
fmu_instance=fmu_instance,
|
|
374
|
+
model_description=self._model_description,
|
|
375
|
+
)
|
|
376
|
+
self._runtime_fmus.append(runtime_instance)
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
class FMIRuntimeInputHead:
|
|
380
|
+
"""Abstract base: implement to feed USD/external values into FMU inputs."""
|
|
381
|
+
def cache_connections(self, instance: FmuRuntimeInstance): pass
|
|
382
|
+
def empty_cache_for(self, instance: FmuRuntimeInstance): pass
|
|
383
|
+
def write_start_values(self, instance: FmuRuntimeInstance): pass
|
|
384
|
+
def get_inputs_for(self, instance: FmuRuntimeInstance): pass
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
class FMIRuntimeOutputTail:
|
|
388
|
+
"""Abstract base: implement to consume FMU outputs and write to USD/renderer."""
|
|
389
|
+
def cache_connections(self, instance: FmuRuntimeInstance): pass
|
|
390
|
+
def empty_cache_for(self, instance: FmuRuntimeInstance): pass
|
|
391
|
+
def write_outputs(self, instance: FmuRuntimeInstance, outputs, result): pass
|
|
392
|
+
def get_outputs_for(self, instance: FmuRuntimeInstance): pass
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
class FMIRuntime:
|
|
396
|
+
def __init__(self, runtime_input_head: FMIRuntimeInputHead, runtime_output_tail: FMIRuntimeOutputTail):
|
|
397
|
+
self._runtime_fmus: dict[str, FmuRuntimeExtractedFMU] = {}
|
|
398
|
+
self._runtime_input_head = runtime_input_head
|
|
399
|
+
self._runtime_output_tail = runtime_output_tail
|
|
400
|
+
|
|
401
|
+
def init(self, parser_instances: dict):
|
|
402
|
+
for parser_instance in parser_instances.values():
|
|
403
|
+
if not parser_instance.enabled:
|
|
404
|
+
continue
|
|
405
|
+
# Check if this is an SSP instance (tagged by _deserialise_instances)
|
|
406
|
+
is_ssp = getattr(parser_instance, '_is_ssp', False)
|
|
407
|
+
if is_ssp:
|
|
408
|
+
from ._ssp_runtime import SspRuntimeExtracted # noqa: PLC0415
|
|
409
|
+
if self._runtime_fmus.get(parser_instance.fmu) is None:
|
|
410
|
+
self._runtime_fmus[parser_instance.fmu] = SspRuntimeExtracted(parser_instance.fmu)
|
|
411
|
+
self._runtime_fmus[parser_instance.fmu].add_instance(parser_instance)
|
|
412
|
+
else:
|
|
413
|
+
if self._runtime_fmus.get(parser_instance.fmu) is None:
|
|
414
|
+
self._runtime_fmus[parser_instance.fmu] = FmuRuntimeExtractedFMU(parser_instance.fmu)
|
|
415
|
+
self._runtime_fmus[parser_instance.fmu].add_instance(parser_instance)
|
|
416
|
+
|
|
417
|
+
def resume(self):
|
|
418
|
+
for runtime_fmu in self._runtime_fmus.values():
|
|
419
|
+
for instance in runtime_fmu.get_runtime_instances():
|
|
420
|
+
self._runtime_input_head.empty_cache_for(instance)
|
|
421
|
+
self._runtime_input_head.cache_connections(instance)
|
|
422
|
+
self._runtime_input_head.write_start_values(instance)
|
|
423
|
+
self._runtime_output_tail.empty_cache_for(instance)
|
|
424
|
+
self._runtime_output_tail.cache_connections(instance)
|
|
425
|
+
instance.resume()
|
|
426
|
+
|
|
427
|
+
def step(self, time: float):
|
|
428
|
+
for runtime_fmu in self._runtime_fmus.values():
|
|
429
|
+
for instance in runtime_fmu.get_runtime_instances():
|
|
430
|
+
inputs = self._runtime_input_head.get_inputs_for(instance)
|
|
431
|
+
outputs = self._runtime_output_tail.get_outputs_for(instance)
|
|
432
|
+
result = instance.step(
|
|
433
|
+
filename=runtime_fmu.get_unzip_dir(),
|
|
434
|
+
inputs=inputs,
|
|
435
|
+
outputs=outputs,
|
|
436
|
+
time=time,
|
|
437
|
+
)
|
|
438
|
+
if result is not None:
|
|
439
|
+
self._runtime_output_tail.write_outputs(instance, outputs, result)
|
|
440
|
+
|
|
441
|
+
def reset(self):
|
|
442
|
+
for runtime_fmu in self._runtime_fmus.values():
|
|
443
|
+
for instance in runtime_fmu.get_runtime_instances():
|
|
444
|
+
self._runtime_input_head.empty_cache_for(instance)
|
|
445
|
+
self._runtime_output_tail.empty_cache_for(instance)
|
|
446
|
+
instance.reset()
|
|
447
|
+
|
|
448
|
+
def destroy(self):
|
|
449
|
+
for runtime_fmu in self._runtime_fmus.values():
|
|
450
|
+
for instance in runtime_fmu.get_runtime_instances():
|
|
451
|
+
self._runtime_input_head.empty_cache_for(instance)
|
|
452
|
+
self._runtime_output_tail.empty_cache_for(instance)
|
|
453
|
+
runtime_fmu.destroy()
|
|
454
|
+
self._runtime_fmus.clear()
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|