pythonfmu3 0.2.1__py3-none-any.whl → 0.2.2__py3-none-any.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.
- pythonfmu3/_version.py +1 -1
- pythonfmu3/resources/binaries/x86_64-linux/libpythonfmu-export.so +0 -0
- pythonfmu3/resources/binaries/x86_64-windows/pythonfmu-export.dll +0 -0
- pythonfmu3/tests/test_variables.py +2 -2
- pythonfmu3/variables.py +4 -0
- {pythonfmu3-0.2.1.dist-info → pythonfmu3-0.2.2.dist-info}/METADATA +1 -1
- {pythonfmu3-0.2.1.dist-info → pythonfmu3-0.2.2.dist-info}/RECORD +11 -11
- {pythonfmu3-0.2.1.dist-info → pythonfmu3-0.2.2.dist-info}/WHEEL +1 -1
- {pythonfmu3-0.2.1.dist-info → pythonfmu3-0.2.2.dist-info}/LICENSE +0 -0
- {pythonfmu3-0.2.1.dist-info → pythonfmu3-0.2.2.dist-info}/entry_points.txt +0 -0
- {pythonfmu3-0.2.1.dist-info → pythonfmu3-0.2.2.dist-info}/top_level.txt +0 -0
pythonfmu3/_version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.2.
|
|
1
|
+
__version__ = "0.2.2"
|
|
Binary file
|
|
Binary file
|
|
@@ -319,14 +319,14 @@ def test_array_to_xml(name, start, dims):
|
|
|
319
319
|
@pytest.mark.requirements("numpy")
|
|
320
320
|
@pytest.mark.parametrize("name,start,dims", [
|
|
321
321
|
("array1", [1.,2.,3.,4.], [4]),
|
|
322
|
-
("array2", [1.,2.,3.,4.], [2, 2])
|
|
322
|
+
("array2", [1.,2.,3.,4.], [2, 2]),
|
|
323
|
+
("array3", [1.,2.,3.,4.,5.,6.,7.,8.], [2, 2, 2])
|
|
323
324
|
])
|
|
324
325
|
def test_array_output_to_xml(name, start, dims):
|
|
325
326
|
import numpy as np
|
|
326
327
|
start = np.reshape(start, newshape=dims)
|
|
327
328
|
r = Float64(name, start, dimensions=[Dimension(start=val) for val in dims], causality=Fmi3Causality.output)
|
|
328
329
|
xml = r.to_xml()
|
|
329
|
-
print(xml, start)
|
|
330
330
|
if start is not None:
|
|
331
331
|
assert xml.attrib['start'] == " ".join([f"{val:.16g}" for val in flatten(start)])
|
|
332
332
|
if dims is not None:
|
pythonfmu3/variables.py
CHANGED
|
@@ -10,6 +10,8 @@ from functools import reduce
|
|
|
10
10
|
|
|
11
11
|
from .enums import Fmi3Causality, Fmi3Initial, Fmi3Variability
|
|
12
12
|
|
|
13
|
+
MAX_LENGTH = 1000
|
|
14
|
+
|
|
13
15
|
def flatten(lst):
|
|
14
16
|
for item in lst:
|
|
15
17
|
if isinstance(item, Iterable) and not isinstance(item, (str, bytes)):
|
|
@@ -219,6 +221,8 @@ class Float64(ModelVariable):
|
|
|
219
221
|
output = ""
|
|
220
222
|
if len(self.dimensions) > 0:
|
|
221
223
|
output = " ".join([f"{val:.16g}" for val in flatten(value)])
|
|
224
|
+
if len(output) > MAX_LENGTH:
|
|
225
|
+
output = output[0]
|
|
222
226
|
else:
|
|
223
227
|
output = f"{value:.16g}"
|
|
224
228
|
attrib[key] = output
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
pythonfmu3/__init__.py,sha256=oN-2oXyCFwq0gvL2IEf5QvwIXBXZgsSBwAJw7LZ9vzc,424
|
|
2
2
|
pythonfmu3/__main__.py,sha256=gC1T8x2d02hhqshyNQGSS70SyCk-3I3t8zPqoRo2Xd8,1543
|
|
3
|
-
pythonfmu3/_version.py,sha256=
|
|
3
|
+
pythonfmu3/_version.py,sha256=m6kyaNpwBcP1XYcqrelX2oS3PJuOnElOcRdBa9pEb8c,22
|
|
4
4
|
pythonfmu3/builder.py,sha256=d_nTRWKohZrZsMbTmxiYJzszzVBp-CRisV_y_OVyW6U,9779
|
|
5
5
|
pythonfmu3/default_experiment.py,sha256=FJ0l0FpU7pT4Pox2RiA2y-Cb_e7DE2XlbWKySRYQaVk,293
|
|
6
6
|
pythonfmu3/deploy.py,sha256=eqFWVxZUkJCLvmq1-GuMNjn2j0VCGoaXPhRWrCk2Vxg,3741
|
|
@@ -10,7 +10,7 @@ pythonfmu3/logmsg.py,sha256=0wn11GLwq0LLWqyC2ktLRjQFWlpj07wWliZ8rUHx1gg,359
|
|
|
10
10
|
pythonfmu3/osutil.py,sha256=1qN6qudN4zCupZwc15pzp52WObkqi6jGy9a-MehNt9Q,656
|
|
11
11
|
pythonfmu3/unit.py,sha256=SjOaywb5lVQbAO_iLjc_7Ly3nYrmAvIW2_hAGt12UFU,1475
|
|
12
12
|
pythonfmu3/variable_types.py,sha256=Q0D4wlGi3i3zE5UsmGJEpNh7SV_W8mn_8p_WIkwrLQA,2881
|
|
13
|
-
pythonfmu3/variables.py,sha256=
|
|
13
|
+
pythonfmu3/variables.py,sha256=GDAbR_BSRsiBlcqpMKE_uvehNiRczgL7xC4BMEj-BJo,12254
|
|
14
14
|
pythonfmu3/pythonfmu-export/.clang-format,sha256=ApbsHWYwilCXJ1iBux4nqOjLkaqgbGLsVrc_U3hX7WI,944
|
|
15
15
|
pythonfmu3/pythonfmu-export/CMakeLists.txt,sha256=p0-4Xh_sAaOI9AVb8lsUsMxJPc6bg9b_6CF6NJt5FHE,1847
|
|
16
16
|
pythonfmu3/pythonfmu-export/build_unix.sh,sha256=I5RrF2O6y0hRG_SN4ExKN_CCFYaa2l-ngKzqmBXnHmA,73
|
|
@@ -27,8 +27,8 @@ pythonfmu3/pythonfmu-export/src/pythonfmu/IPyState.hpp,sha256=GLiOjhKLDVEICersnq
|
|
|
27
27
|
pythonfmu3/pythonfmu-export/src/pythonfmu/PySlaveInstance.cpp,sha256=WShZMdZExWWG86kFPh89mATYK4tVn38JdHV6c-fZ0_A,25411
|
|
28
28
|
pythonfmu3/pythonfmu-export/src/pythonfmu/PySlaveInstance.hpp,sha256=T-epGp68SjhDv-JupxUe2ZgnV8unU4htc-PUBokjWm4,4239
|
|
29
29
|
pythonfmu3/pythonfmu-export/src/pythonfmu/PyState.hpp,sha256=CjFEIrZu8b1jxQAIgfI_o36hyItW_SdQ5VSkImf7JNs,2977
|
|
30
|
-
pythonfmu3/resources/binaries/x86_64-linux/libpythonfmu-export.so,sha256=
|
|
31
|
-
pythonfmu3/resources/binaries/x86_64-windows/pythonfmu-export.dll,sha256=
|
|
30
|
+
pythonfmu3/resources/binaries/x86_64-linux/libpythonfmu-export.so,sha256=Vl27I8aGZVvDEDWkZGci2JhhcW9ullzBVsp7LIfkVXA,358808
|
|
31
|
+
pythonfmu3/resources/binaries/x86_64-windows/pythonfmu-export.dll,sha256=PU1mPc09f4togi37zOB61nriYavf56JN8Sj_Q4u0Tgw,431104
|
|
32
32
|
pythonfmu3/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
33
|
pythonfmu3/tests/conftest.py,sha256=B6XxTnBdeF_tEJ3w2DlfPKUfvlk-oULgIhQtXkgOJIc,171
|
|
34
34
|
pythonfmu3/tests/test_builder.py,sha256=GrD4ziin3RLOe_36rBQCMnKrSkhc3IqnxE1a6kCFPok,6842
|
|
@@ -37,7 +37,7 @@ pythonfmu3/tests/test_fmi3slave.py,sha256=1uwTdfiFZNmU0yzIdC30kAuu95xsZSTMA9CGk_
|
|
|
37
37
|
pythonfmu3/tests/test_integration.py,sha256=zA3iJ4rI2cKEE8mDsAmcVuwNWlJzhonV8Wxz92hzEac,10387
|
|
38
38
|
pythonfmu3/tests/test_logger.py,sha256=OcHQhxUtNBPH-0zdmheC4I9OWz1yu48W8MYDshNVkf8,5765
|
|
39
39
|
pythonfmu3/tests/test_multiple_fmus.py,sha256=-sthCm2YUZiRkdfvpLQNgquPBForUKQ7HGqfFBdrRas,3942
|
|
40
|
-
pythonfmu3/tests/test_variables.py,sha256=
|
|
40
|
+
pythonfmu3/tests/test_variables.py,sha256=FL7eUCXH4RmH0rK0k6qXDnyDzthW_wAWJBHEmC-u8SI,10384
|
|
41
41
|
pythonfmu3/tests/utils.py,sha256=WusWSUGoBPenZL-FAKQlzaHN2aYXiznZM2fwCjoldwY,301
|
|
42
42
|
pythonfmu3/tests/data/csvdemo.csv,sha256=TiTUyzHyjQNXM4eXI33oJipc7w9_PJ8aMejRmwc52Xw,256
|
|
43
43
|
pythonfmu3/tests/data/hello.txt,sha256=wFNeS-K3n_2TKRMFQ2v4iTFOSj-uwF7P_Lt98xrZ5Ro,12
|
|
@@ -46,9 +46,9 @@ pythonfmu3/tests/slaves/localmodule.py,sha256=-q5Lmh2I88MG7nLTscms0n5xhHLkUDed1I
|
|
|
46
46
|
pythonfmu3/tests/slaves/pythonslave.py,sha256=uzrTQmfk0QBalxNTviGMZNph_YgVmcbxPqKgX5rSvXg,2172
|
|
47
47
|
pythonfmu3/tests/slaves/pythonslave_read_file.py,sha256=t2sDaZSr2veD91gdqCO9W9CN-AN3TyXABXXfV9Rt0Xs,791
|
|
48
48
|
pythonfmu3/tests/slaves/slavewithdep.py,sha256=hHDFB0dw8wkHiGzxeAVbz9O5LR6ghsFeONgRFdiK_t0,812
|
|
49
|
-
pythonfmu3-0.2.
|
|
50
|
-
pythonfmu3-0.2.
|
|
51
|
-
pythonfmu3-0.2.
|
|
52
|
-
pythonfmu3-0.2.
|
|
53
|
-
pythonfmu3-0.2.
|
|
54
|
-
pythonfmu3-0.2.
|
|
49
|
+
pythonfmu3-0.2.2.dist-info/LICENSE,sha256=RL2018BU2DKcTi8Eb4ODF-XF3wnr7SDKvMP5S49x4rQ,1188
|
|
50
|
+
pythonfmu3-0.2.2.dist-info/METADATA,sha256=Efceh_-9mn6WI8FJ9LsVmh95qkrJ133c-0xYuaIaSc8,7585
|
|
51
|
+
pythonfmu3-0.2.2.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
|
52
|
+
pythonfmu3-0.2.2.dist-info/entry_points.txt,sha256=GgkWYs0DKGHLcijMEYZGkhkHOK2RVUpjGwvl1fwyDwQ,60
|
|
53
|
+
pythonfmu3-0.2.2.dist-info/top_level.txt,sha256=6ne7bh_cME1hepxCx1BG8N5QVhVAufrp7LLok6vq7nE,11
|
|
54
|
+
pythonfmu3-0.2.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|