fmu-manipulation-toolbox 1.9rc9__py3-none-any.whl → 1.9rc10__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.
@@ -1 +1 @@
1
- 'V1.9-rc9'
1
+ 'V1.9-rc10'
@@ -111,16 +111,10 @@ class FMUSplitter:
111
111
  fmu_file.writestr(file[len(directory):], data)
112
112
  logger.info(f"FMU Extraction of '{filename}'")
113
113
 
114
-
115
114
  class FMUSplitterDescription:
116
115
  def __init__(self, zip):
117
116
  self.zip = zip
118
- self.links: Dict[str, Dict[int, FMUSplitterLink]] = {
119
- "Real": {},
120
- "Integer": {},
121
- "Boolean": {},
122
- "String": {}
123
- }
117
+ self.links: Dict[str, Dict[int, FMUSplitterLink]] = dict((el, {}) for el in EmbeddedFMUPort.ALL_TYPES)
124
118
  self.vr_to_name: Dict[str, Dict[str, Dict[int, Dict[str, str]]]] = {} # name, fmi_type, vr <-> {name, causality}
125
119
  self.config: Dict[str, Any] = {
126
120
  "auto_input": False,
@@ -133,10 +127,11 @@ class FMUSplitterDescription:
133
127
 
134
128
  # used for modelDescription.xml parsing
135
129
  self.current_fmu_filename = None
130
+ self.current_fmi_version = None
136
131
  self.current_vr = None
137
132
  self.current_name = None
138
133
  self.current_causality = None
139
- self.supported_fmi_types: Tuple[str] = ()
134
+ self.supported_fmi_types: Tuple[str] = tuple()
140
135
 
141
136
  @staticmethod
142
137
  def get_line(file):
@@ -146,14 +141,23 @@ class FMUSplitterDescription:
146
141
  return line
147
142
  raise StopIteration
148
143
 
149
- def start_element(self, name, attrs):
150
- if name == "ScalarVariable":
144
+ def start_element(self, tag, attrs):
145
+ if tag == "fmiModelDescription":
146
+ self.current_fmi_version = attrs["fmiVersion"]
147
+ elif tag == "ScalarVariable":
151
148
  self.current_name = attrs["name"]
152
149
  self.current_vr = int(attrs["valueReference"])
153
150
  self.current_causality = attrs["causality"]
154
- elif name in self.vr_to_name[self.current_fmu_filename]:
155
- self.vr_to_name[self.current_fmu_filename][name][self.current_vr] = {"name": self.current_name,
156
- "causality": self.current_causality}
151
+ elif self.current_fmi_version == "2.0" and tag in EmbeddedFMUPort.FMI_TO_CONTAINER[2]:
152
+ fmi_type = EmbeddedFMUPort.FMI_TO_CONTAINER[2][tag]
153
+ self.vr_to_name[self.current_fmu_filename][fmi_type][self.current_vr] = {
154
+ "name": self.current_name,
155
+ "causality": self.current_causality}
156
+ elif self.current_fmi_version == "3.0" and tag in EmbeddedFMUPort.FMI_TO_CONTAINER[3]:
157
+ fmi_type = EmbeddedFMUPort.FMI_TO_CONTAINER[3][tag]
158
+ self.vr_to_name[self.current_fmu_filename][fmi_type][int(attrs["valueReference"])] = {
159
+ "name": attrs["name"],
160
+ "causality": attrs["causality"]}
157
161
  else:
158
162
  self.current_vr = None
159
163
  self.current_name = None
@@ -166,14 +170,10 @@ class FMUSplitterDescription:
166
170
  else:
167
171
  filename = f"{directory}/modelDescription.xml"
168
172
 
169
- self.vr_to_name[fmu_filename] = {
170
- "Real": {},
171
- "Integer": {},
172
- "Boolean": {},
173
- "String": {}
174
- }
173
+ self.vr_to_name[fmu_filename] = dict((el, {}) for el in EmbeddedFMUPort.ALL_TYPES)
175
174
  parser = xml.parsers.expat.ParserCreate()
176
175
  self.current_fmu_filename = fmu_filename
176
+ self.current_fmi_version = None
177
177
  self.current_vr = None
178
178
  self.current_name = None
179
179
  self.current_causality = None
@@ -266,14 +266,14 @@ class FMUSplitterDescription:
266
266
  def parse_txt_file(self, txt_filename: str):
267
267
  self.parse_model_description(str(Path(txt_filename).parent.parent), ".")
268
268
  logger.debug(f"Parsing container file '{txt_filename}'")
269
-
270
269
  with (self.zip.open(txt_filename) as file):
271
270
  self.parse_txt_file_header(file, txt_filename)
272
271
  self.parse_txt_file_ports(file)
273
272
 
274
273
  for fmu_filename in self.config["candidate_fmu"]:
275
274
  # Inputs per FMUs
276
- for fmi_type in ("Real", "Integer", "Boolean", "String"):
275
+
276
+ for fmi_type in self.supported_fmi_types:
277
277
  nb_input = int(self.get_line(file))
278
278
  for i in range(nb_input):
279
279
  local, vr = self.get_line(file).split(" ")
@@ -285,7 +285,7 @@ class FMUSplitterDescription:
285
285
  link.to_port.append(FMUSplitterPort(fmu_filename,
286
286
  self.vr_to_name[fmu_filename][fmi_type][int(vr)]["name"]))
287
287
 
288
- for fmi_type in ("Real", "Integer", "Boolean", "String"):
288
+ for fmi_type in self.supported_fmi_types:
289
289
  nb_start = int(self.get_line(file))
290
290
  for i in range(nb_start):
291
291
  tokens = self.get_line(file).split(" ")
@@ -299,7 +299,7 @@ class FMUSplitterDescription:
299
299
  self.config["start"] = [start_definition]
300
300
 
301
301
  # Output per FMUs
302
- for fmi_type in ("Real", "Integer", "Boolean", "String"):
302
+ for fmi_type in self.supported_fmi_types:
303
303
  nb_output = int(self.get_line(file))
304
304
 
305
305
  for i in range(nb_output):
@@ -311,6 +311,10 @@ class FMUSplitterDescription:
311
311
  self.links[fmi_type][local] = link
312
312
  link.from_port = FMUSplitterPort(fmu_filename,
313
313
  self.vr_to_name[fmu_filename][fmi_type][int(vr)]["name"])
314
+ #conversion
315
+ nb_conversion = int(self.get_line(file))
316
+ for i in range(nb_conversion):
317
+ self.get_line(file)
314
318
 
315
319
  logger.debug("End of parsing.")
316
320
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fmu_manipulation_toolbox
3
- Version: 1.9rc9
3
+ Version: 1.9rc10
4
4
  Summary: FMU Manipulation Toolbox is a python application for modifying Functional Mock-up Units (FMUs) without recompilation or bundling them into FMU Containers
5
5
  Home-page: https://github.com/grouperenault/fmu_manipulation_toolbox/
6
6
  Author: Nicolas.LAURENT@Renault.com
@@ -1,6 +1,6 @@
1
1
  fmu_manipulation_toolbox/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  fmu_manipulation_toolbox/__main__.py,sha256=FpG0ITBz5q-AvIbXplVh_1g1zla5souFGtpiDdECxEw,352
3
- fmu_manipulation_toolbox/__version__.py,sha256=a17zC1vWGKiyRqtqXxKoo5DItHBYHj480oIEWpgEdNw,11
3
+ fmu_manipulation_toolbox/__version__.py,sha256=qsgfXycp13M4xRN0pMnvl2so7SqkBob6ChBzoU2KO50,12
4
4
  fmu_manipulation_toolbox/assembly.py,sha256=XQ_1sB6K1Dk2mnNe-E3_6Opoeub7F9Qaln0EUDzsop8,26553
5
5
  fmu_manipulation_toolbox/checker.py,sha256=jw1omfrMMIMHlIpHXpWBcQgIiS9hnHe5T9CZ5KlbVGs,2422
6
6
  fmu_manipulation_toolbox/container.py,sha256=Ed6JsWM2oMs-jyGyKmrHHebNuG4qwiGLYtx0BREIiBE,45710
@@ -9,7 +9,7 @@ fmu_manipulation_toolbox/gui_style.py,sha256=s6WdrnNd_lCMWhuBf5LKK8wrfLXCU7pFTLU
9
9
  fmu_manipulation_toolbox/help.py,sha256=j8xmnCrwQpaW-SZ8hSqA1dlTXgaqzQWc4Yr3RH_oqck,6012
10
10
  fmu_manipulation_toolbox/operations.py,sha256=VQvFXRHF48e-ZLqoG8nbz61iB5lX6qAkqZHQ0m0lUPw,20577
11
11
  fmu_manipulation_toolbox/remoting.py,sha256=N25MDFkIcEWe9CIT1M4L9kea3j-8E7i2I1VOI6zIAdw,3876
12
- fmu_manipulation_toolbox/split.py,sha256=ONl1T37xJypF45GH3sZC6gKMSQ83xEl4xAWDSEOJsao,13571
12
+ fmu_manipulation_toolbox/split.py,sha256=yFaW6yhvFjOXpRynWzitR7o7uSrxb-RxeFzmQNxUFHI,14147
13
13
  fmu_manipulation_toolbox/version.py,sha256=OhBLkZ1-nhC77kyvffPNAf6m8OZe1bYTnNf_PWs1NvM,392
14
14
  fmu_manipulation_toolbox/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  fmu_manipulation_toolbox/cli/fmucontainer.py,sha256=6UaSSY6UGGlOfIh_CTG-Gk3ZPSd88Pi2cFCuzb87eks,4839
@@ -33,7 +33,7 @@ fmu_manipulation_toolbox/resources/icon_fmu.png,sha256=EuygB2xcoM2WAfKKdyKG_UvTL
33
33
  fmu_manipulation_toolbox/resources/license.txt,sha256=5ODuU8g8pIkK-NMWXu_rjZ6k7gM7b-N2rmg87-2Kmqw,1583
34
34
  fmu_manipulation_toolbox/resources/mask.png,sha256=px1U4hQGL0AmZ4BQPknOVREpMpTSejbah3ntkpqAzFA,3008
35
35
  fmu_manipulation_toolbox/resources/model.png,sha256=EAf_HnZJe8zYGZygerG1MMt2U-tMMZlifzXPj4_iORA,208788
36
- fmu_manipulation_toolbox/resources/darwin64/container.dylib,sha256=5LphcmCaBa76MIq8WoA5FwhLNgu3LxmcaWa49dGQ11I,161560
36
+ fmu_manipulation_toolbox/resources/darwin64/container.dylib,sha256=Qr6zN0nLpe3PgpYk8rXvAS_1se9qyj_06cCd9443n08,161560
37
37
  fmu_manipulation_toolbox/resources/fmi-2.0/fmi2Annotation.xsd,sha256=OGfyJtaJntKypX5KDpuZ-nV1oYLZ6HV16pkpKOmYox4,2731
38
38
  fmu_manipulation_toolbox/resources/fmi-2.0/fmi2AttributeGroups.xsd,sha256=HwyV7LBse-PQSv4z1xjmtzPU3Hjnv4mluq9YdSBNHMQ,3704
39
39
  fmu_manipulation_toolbox/resources/fmi-2.0/fmi2ModelDescription.xsd,sha256=JM4j_9q-pc40XYHb28jfT3iV3aYM5JLqD5aRjO72K1E,18939
@@ -53,19 +53,19 @@ fmu_manipulation_toolbox/resources/fmi-3.0/fmi3Type.xsd,sha256=TaHRoUBIFtmdEwBKB
53
53
  fmu_manipulation_toolbox/resources/fmi-3.0/fmi3Unit.xsd,sha256=CK_F2t5LfyQ6eSNJ8soTFMVK9DU8vD2WiMi2MQvjB0g,3746
54
54
  fmu_manipulation_toolbox/resources/fmi-3.0/fmi3Variable.xsd,sha256=3YU-3q1-c-namz7sMe5cxnmOVOJsRSmfWR02PKv3xaU,19171
55
55
  fmu_manipulation_toolbox/resources/fmi-3.0/fmi3VariableDependency.xsd,sha256=YQSBwXt4IsDlyegY8bX-qQHGSfE5TipTPfo2g2yqq1c,3082
56
- fmu_manipulation_toolbox/resources/linux32/client_sm.so,sha256=9-lH-dE6QqWg_FNxsFcF9zismk2Qq3PXNWSOqE2pBMk,34756
56
+ fmu_manipulation_toolbox/resources/linux32/client_sm.so,sha256=TMVU2DhAnec90k0UvXkonybGGZlskonW-BIZ6qE9koM,34756
57
57
  fmu_manipulation_toolbox/resources/linux32/server_sm,sha256=gzKU0BTeaRkvhTMQtHHj3K8uYFyEdyGGn_mZy_jG9xo,21304
58
- fmu_manipulation_toolbox/resources/linux64/client_sm.so,sha256=p4zIi1YKQ_81oA6IaMOkKZGwkG-POi4vGj4TKemoHuY,32592
59
- fmu_manipulation_toolbox/resources/linux64/container.so,sha256=nqZspiOIdn1DwHdCEPJiEybE1JyeO2wTGGQacMYUXqM,135520
58
+ fmu_manipulation_toolbox/resources/linux64/client_sm.so,sha256=CSQBv69pCLIzTtwu9gGMepzGRUoBoUU-j-Vr1jAncjc,32592
59
+ fmu_manipulation_toolbox/resources/linux64/container.so,sha256=T_y9zagScUszMN12RJ4EERwCF2ssipD89ePdoWnZLmQ,135520
60
60
  fmu_manipulation_toolbox/resources/linux64/server_sm,sha256=MZn6vITN2qpBHYt_RaK2VnFFp00hk8fTALBHmXPtLwc,22608
61
- fmu_manipulation_toolbox/resources/win32/client_sm.dll,sha256=E0TqeuNbYeV3tp0S5PFMIK6ipTN4TCWeaUKAbTcHbnE,17920
62
- fmu_manipulation_toolbox/resources/win32/server_sm.exe,sha256=otceaiC_nRbGCtlExCBl8IlqHd4KMsRTPdVhHMx-jic,15360
63
- fmu_manipulation_toolbox/resources/win64/client_sm.dll,sha256=3DfTRKHVfwNvcOFjJbpe7T4Jm_wcenQ9x81hJQw2xwk,21504
64
- fmu_manipulation_toolbox/resources/win64/container.dll,sha256=iy0XO-TUcD27VLiKejB9kJTdBUUt0oh9J-kt1A_u_FI,98816
65
- fmu_manipulation_toolbox/resources/win64/server_sm.exe,sha256=_61NOrYKKUa0B_wZhogr47x8-1ppUCcaOsYRkrZ31Hc,18432
66
- fmu_manipulation_toolbox-1.9rc9.dist-info/licenses/LICENSE.txt,sha256=c_862mzyk6ownO3Gt6cVs0-53IXLi_-ZEQFNDVabESw,1285
67
- fmu_manipulation_toolbox-1.9rc9.dist-info/METADATA,sha256=m0zac5QSzdnCaQKDSXMt8bPm--ReqaBXPxNVkhOOQ3U,1156
68
- fmu_manipulation_toolbox-1.9rc9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
69
- fmu_manipulation_toolbox-1.9rc9.dist-info/entry_points.txt,sha256=HjOZkflbI1IuSY8BpOZre20m24M4GDQGCJfPIa7NrlY,264
70
- fmu_manipulation_toolbox-1.9rc9.dist-info/top_level.txt,sha256=9D_h-5BMjSqf9z-XFkbJL_bMppR2XNYW3WNuPkXou0k,25
71
- fmu_manipulation_toolbox-1.9rc9.dist-info/RECORD,,
61
+ fmu_manipulation_toolbox/resources/win32/client_sm.dll,sha256=q7lMEHcmNgV3zsHzjGSMLnFO0KcolGSWTAr7WCb2EsI,17920
62
+ fmu_manipulation_toolbox/resources/win32/server_sm.exe,sha256=tNUKn-KrTQfiM-9_H-HDgovI_okt2lnnErt7Mw1ATYQ,15360
63
+ fmu_manipulation_toolbox/resources/win64/client_sm.dll,sha256=XTe0zd8CDxg3NmP2G91z2F6J3HfzEuRya-xAEEoV94g,21504
64
+ fmu_manipulation_toolbox/resources/win64/container.dll,sha256=aj9N02L8cysKZSR2RPvPKV5e9eMV2aHUz0-XNq6iKK8,98816
65
+ fmu_manipulation_toolbox/resources/win64/server_sm.exe,sha256=hLmKvTddvh8q0iIpySMAhAebv1LZkf53uMpKKIJn3Fs,18432
66
+ fmu_manipulation_toolbox-1.9rc10.dist-info/licenses/LICENSE.txt,sha256=c_862mzyk6ownO3Gt6cVs0-53IXLi_-ZEQFNDVabESw,1285
67
+ fmu_manipulation_toolbox-1.9rc10.dist-info/METADATA,sha256=QV7q42tQJ29jmn9Xz07jOg0gI_g_8LPqy5XYgMcSjb4,1157
68
+ fmu_manipulation_toolbox-1.9rc10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
69
+ fmu_manipulation_toolbox-1.9rc10.dist-info/entry_points.txt,sha256=HjOZkflbI1IuSY8BpOZre20m24M4GDQGCJfPIa7NrlY,264
70
+ fmu_manipulation_toolbox-1.9rc10.dist-info/top_level.txt,sha256=9D_h-5BMjSqf9z-XFkbJL_bMppR2XNYW3WNuPkXou0k,25
71
+ fmu_manipulation_toolbox-1.9rc10.dist-info/RECORD,,