fmu-manipulation-toolbox 1.8.2.dev2__py3-none-any.whl → 1.8.2.dev4__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.8.2-dev2'
1
+ 'V1.8.2-dev4'
@@ -38,7 +38,7 @@ class Connection:
38
38
 
39
39
  class AssemblyNode:
40
40
  def __init__(self, name: Optional[str], step_size: float = None, mt=False, profiling=False,
41
- auto_link=True, auto_input=True, auto_output=True, auto_parameter=False):
41
+ auto_link=True, auto_input=True, auto_output=True, auto_parameter=False, auto_local=False):
42
42
  self.name = name
43
43
  if step_size:
44
44
  try:
@@ -54,6 +54,7 @@ class AssemblyNode:
54
54
  self.auto_input = auto_input
55
55
  self.auto_output = auto_output
56
56
  self.auto_parameter = auto_parameter
57
+ self.auto_local = auto_local
57
58
 
58
59
  self.parent: Optional[AssemblyNode] = None
59
60
  self.children: Dict[str, AssemblyNode] = {} # sub-containers
@@ -128,7 +129,8 @@ class AssemblyNode:
128
129
  container.add_implicit_rule(auto_input=self.auto_input,
129
130
  auto_output=self.auto_output,
130
131
  auto_link=self.auto_link,
131
- auto_parameter=self.auto_parameter)
132
+ auto_parameter=self.auto_parameter,
133
+ auto_local=self.auto_local)
132
134
 
133
135
  container.make_fmu(self.name, self.step_size, mt=self.mt, profiling=self.profiling, debug=debug)
134
136
 
@@ -209,7 +211,8 @@ class AssemblyError(Exception):
209
211
 
210
212
  class Assembly:
211
213
  def __init__(self, filename: str, step_size=None, auto_link=True, auto_input=True, debug=False,
212
- auto_output=True, mt=False, profiling=False, fmu_directory: Path = Path("."), auto_parameter=False):
214
+ auto_output=True, mt=False, profiling=False, fmu_directory: Path = Path("."), auto_parameter=False,
215
+ auto_local=False):
213
216
  self.filename = Path(filename)
214
217
  self.default_auto_input = auto_input
215
218
  self.debug = debug
@@ -217,6 +220,7 @@ class Assembly:
217
220
  self.default_step_size = step_size
218
221
  self.default_auto_link = auto_link
219
222
  self.default_auto_parameter = auto_parameter
223
+ self.default_auto_local = auto_local
220
224
  self.default_mt = mt
221
225
  self.default_profiling = profiling
222
226
  self.fmu_directory = fmu_directory
@@ -274,7 +278,7 @@ class Assembly:
274
278
  self.root = AssemblyNode(name, step_size=self.default_step_size, auto_link=self.default_auto_link,
275
279
  mt=self.default_mt, profiling=self.default_profiling,
276
280
  auto_input=self.default_auto_input, auto_output=self.default_auto_output,
277
- auto_parameter=self.default_auto_parameter)
281
+ auto_parameter=self.default_auto_parameter, auto_local=self.default_auto_local)
278
282
 
279
283
  with open(self.input_pathname) as file:
280
284
  reader = csv.reader(file, delimiter=';')
@@ -379,14 +383,16 @@ class Assembly:
379
383
  auto_input = data.get("auto_input", self.default_auto_input) # 5
380
384
  auto_output = data.get("auto_output", self.default_auto_output) # 6
381
385
  auto_parameter = data.get("auto_parameter", self.default_auto_parameter) # 6b
386
+ auto_local = data.get("auto_local", self.default_auto_local) # 6c
382
387
  step_size = data.get("step_size", self.default_step_size) # 7
383
388
 
384
389
  node = AssemblyNode(name, step_size=step_size, auto_link=auto_link, mt=mt, profiling=profiling,
385
- auto_input=auto_input, auto_output=auto_output, auto_parameter=auto_parameter)
390
+ auto_input=auto_input, auto_output=auto_output, auto_parameter=auto_parameter,
391
+ auto_local=auto_local)
386
392
 
387
393
  for key, value in data.items():
388
394
  if key in ('name', 'step_size', 'auto_link', 'auto_input', 'auto_output', 'mt', 'profiling',
389
- 'auto_parameter'):
395
+ 'auto_parameter', 'auto_local'):
390
396
  continue # Already read
391
397
 
392
398
  elif key == "container": # 8
@@ -447,6 +453,7 @@ class Assembly:
447
453
  json_node["auto_input"] = node.auto_input # 5
448
454
  json_node["auto_output"] = node.auto_output # 6
449
455
  json_node["auto_parameter"] = node.auto_parameter # 6b
456
+ json_node["auto_local"] = node.auto_local # 6c
450
457
 
451
458
  if node.step_size:
452
459
  json_node["step_size"] = node.step_size # 7
@@ -179,6 +179,9 @@ def fmucontainer():
179
179
  parser.add_argument("-auto-parameter", action="store_true", dest="auto_parameter", default=False,
180
180
  help="Expose parameters of the embedded fmu's.")
181
181
 
182
+ parser.add_argument("-auto-local", action="store_true", dest="auto_local", default=False,
183
+ help="Expose local variables of the embedded fmu's.")
184
+
182
185
  parser.add_argument("-no-auto-link", action="store_false", dest="auto_link", default=True,
183
186
  help="Create ONLY explicit links.")
184
187
 
@@ -208,7 +211,8 @@ def fmucontainer():
208
211
  filename = description
209
212
  try:
210
213
  assembly = Assembly(filename, step_size=step_size, auto_link=config.auto_link,
211
- auto_input=config.auto_input, auto_output=config.auto_output, mt=config.mt,
214
+ auto_input=config.auto_input, auto_output=config.auto_output,
215
+ auto_local=config.auto_local, mt=config.mt,
212
216
  profiling=config.profiling, fmu_directory=fmu_directory, debug=config.debug,
213
217
  auto_parameter=config.auto_parameter)
214
218
  except FileNotFoundError as e:
@@ -308,7 +308,8 @@ class FMUContainer:
308
308
  return ContainerPort(fmu, port.name)
309
309
  return None
310
310
 
311
- def add_implicit_rule(self, auto_input=True, auto_output=True, auto_link=True, auto_parameter=False):
311
+ def add_implicit_rule(self, auto_input=True, auto_output=True, auto_link=True, auto_parameter=False,
312
+ auto_local=False):
312
313
  # Auto Link outputs
313
314
  for fmu in self.execution_order:
314
315
  for port_name in fmu.ports:
@@ -332,11 +333,17 @@ class FMUContainer:
332
333
  self.mark_ruled(cport, 'OUTPUT')
333
334
  self.outputs[port_name] = cport
334
335
  logger.info(f"AUTO OUTPUT: Expose {cport}")
335
- elif cport.port.causality == 'local' and port_name.startswith("container."):
336
- local_portname = "container." + cport.fmu.id + "." + port_name[10:]
337
- self.mark_ruled(cport, 'OUTPUT')
338
- self.outputs[local_portname] = cport
339
- logger.info(f"PROFILING: Expose {cport}")
336
+ elif cport.port.causality == 'local':
337
+ local_portname = None
338
+ if port_name.startswith("container."):
339
+ local_portname = "container." + cport.fmu.id + "." + port_name[10:]
340
+ logger.info(f"PROFILING: Expose {cport}")
341
+ elif auto_local:
342
+ local_portname = cport.fmu.id + "." + port_name
343
+ logger.info(f"AUTO LOCAL: Expose {cport}")
344
+ if local_portname:
345
+ self.mark_ruled(cport, 'OUTPUT')
346
+ self.outputs[local_portname] = cport
340
347
 
341
348
  if auto_input:
342
349
  # Auto link inputs
@@ -668,7 +675,6 @@ class FMUContainer:
668
675
  os.path.relpath(os.path.join(root, file), base_directory))
669
676
  logger.info(f"'{fmu_filename}' is available.")
670
677
 
671
- @staticmethod
672
- def make_fmu_cleanup(base_directory: Path):
678
+ def make_fmu_cleanup(self, base_directory: Path):
673
679
  logger.debug(f"Delete directory '{base_directory}'")
674
- shutil.rmtree(base_directory)
680
+ shutil.rmtree(self.long_path(base_directory))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: fmu_manipulation_toolbox
3
- Version: 1.8.2.dev2
3
+ Version: 1.8.2.dev4
4
4
  Summary: FMU Manipulation Toobox is a python application which help to modify a Functional Mock-up Units (FMUs) without recompilation or to group them into FMU Containers
5
5
  Home-page: https://github.com/grouperenault/fmu_manipulation_toolbox/
6
6
  Author: Nicolas.LAURENT@Renault.com
@@ -1,10 +1,10 @@
1
1
  fmu_manipulation_toolbox/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
2
2
  fmu_manipulation_toolbox/__main__.py,sha256=mAzrtkil506DS0F3g3CEbHdtZsZotzntcNhIn_lNJkw,344
3
- fmu_manipulation_toolbox/__version__.py,sha256=XRMZw6r5zNWqAwUNVSOks2uHYTZKCrn1E3G40AmC86I,14
4
- fmu_manipulation_toolbox/assembly.py,sha256=pgGuePOsUbPqTP3IYbeHtMIaqm8dCqI1k55dIezcAEg,25080
3
+ fmu_manipulation_toolbox/__version__.py,sha256=j6FaYga73uUHXyGuI1eM_Hg2B5t4QR2p3FdDGukGywE,14
4
+ fmu_manipulation_toolbox/assembly.py,sha256=pAAE_eWPfD-8BzZ7gvaHARhQt4-IV2jVvsMnJXeAtLI,25541
5
5
  fmu_manipulation_toolbox/checker.py,sha256=lE2MpH4BAKCDjUvbr06N56u7ao8hWXaJgMKaLvmhFTQ,2272
6
- fmu_manipulation_toolbox/cli.py,sha256=g_03DdH5lNZ7DsD5CoAeA_nGeDlsw19nhli9dousdew,10347
7
- fmu_manipulation_toolbox/fmu_container.py,sha256=SGA-zSLyHojkg1upXA6wdM-KaZTsl6FO5UtSRZt2YkY,28390
6
+ fmu_manipulation_toolbox/cli.py,sha256=PVdz2eg-D7bnkPXjke7t9_mAuT77gBJWib558HB2-p8,10582
7
+ fmu_manipulation_toolbox/fmu_container.py,sha256=VTZlRTXAYcaYLijgN4ReuG6hLQ2XRgxctPJdEYRfOcc,28755
8
8
  fmu_manipulation_toolbox/fmu_operations.py,sha256=WE-lCNNOYr3pakMkwzpsp_lBhb2P4s7Ez5HnxQLbVdk,15814
9
9
  fmu_manipulation_toolbox/gui.py,sha256=bGG4iPddGsT4tLBv1zjSpbIkyctHVfbRt0kGxdTTrTc,29219
10
10
  fmu_manipulation_toolbox/gui_style.py,sha256=jjDhzSw5hu_6-bOOhsvI_MxQZOqt9SjpKK6T83Gubr4,2926
@@ -37,16 +37,16 @@ fmu_manipulation_toolbox/resources/fmi-2.0/fmi2VariableDependency.xsd,sha256=Tc9
37
37
  fmu_manipulation_toolbox/resources/linux32/client_sm.so,sha256=xVdY2zy13pa2DcvFiweSNpp7E6DiONqeoBdlcJHrW_k,35940
38
38
  fmu_manipulation_toolbox/resources/linux32/server_sm,sha256=1TLGqNPyM5UVOrCfzNqWyF6ClLksY3EiY3CSsrnp6c0,22836
39
39
  fmu_manipulation_toolbox/resources/linux64/client_sm.so,sha256=EhY1XHo1YcQn6yqZ7wk5okqtZyp0MrcCsGcudqE-aIM,37000
40
- fmu_manipulation_toolbox/resources/linux64/container.so,sha256=mlzbV-mzP9umrY_7WM4mpxohEG97uTjEpc6nxlv1f-c,45984
40
+ fmu_manipulation_toolbox/resources/linux64/container.so,sha256=vT6W-xb6sdybEFnujZEO5lvl2zwf_0VCEtsn0PL28Cs,45984
41
41
  fmu_manipulation_toolbox/resources/linux64/server_sm,sha256=ulfoPvmaYe9nInYcVEyj7mD9zDzGk56OUoWx1mPKLiE,22768
42
- fmu_manipulation_toolbox/resources/win32/client_sm.dll,sha256=wct4eXJaoHjb-IZkVJJUbnCsdRE-61C_IQF9LUNIEwQ,17920
43
- fmu_manipulation_toolbox/resources/win32/server_sm.exe,sha256=YVqy_jmyCMe1AXV0Gg3uUZyUHjDn0sGOw1L6OptauUQ,15872
44
- fmu_manipulation_toolbox/resources/win64/client_sm.dll,sha256=eI6HGuuX9zVAWTAc0veQo4VqD8m0WswxO_zcaYbJxvQ,22016
45
- fmu_manipulation_toolbox/resources/win64/container.dll,sha256=YwnHFnuuv_fZG1KdkBqf4iWagLlGXeuEfjVOr4Lm4BE,36864
46
- fmu_manipulation_toolbox/resources/win64/server_sm.exe,sha256=1AJoXNlr-dKzrcdNKsqU_iQYtK1WgWBU039jL61aofY,19456
47
- fmu_manipulation_toolbox-1.8.2.dev2.dist-info/LICENSE.txt,sha256=c_862mzyk6ownO3Gt6cVs0-53IXLi_-ZEQFNDVabESw,1285
48
- fmu_manipulation_toolbox-1.8.2.dev2.dist-info/METADATA,sha256=QJH35Er0kNos3fOG2ZyW0V39EPevhax9Zbv8Xw2QWaA,1068
49
- fmu_manipulation_toolbox-1.8.2.dev2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
50
- fmu_manipulation_toolbox-1.8.2.dev2.dist-info/entry_points.txt,sha256=jCPLMBdS-eOvmRfDv7n0wHZSbJHccHviW03mz5vwO-Q,124
51
- fmu_manipulation_toolbox-1.8.2.dev2.dist-info/top_level.txt,sha256=9D_h-5BMjSqf9z-XFkbJL_bMppR2XNYW3WNuPkXou0k,25
52
- fmu_manipulation_toolbox-1.8.2.dev2.dist-info/RECORD,,
42
+ fmu_manipulation_toolbox/resources/win32/client_sm.dll,sha256=hHVz73BsPfqHAp57iDI36LC1528P6PnHcEVjeaVdlO4,17920
43
+ fmu_manipulation_toolbox/resources/win32/server_sm.exe,sha256=gP9raQQLJoAudrKod9Ge75DixILc4amtoneSmTPJ_8U,15872
44
+ fmu_manipulation_toolbox/resources/win64/client_sm.dll,sha256=Bqa4ubYbyZ_-FLquFAbZf6DxYMt3qdqLQ_t_GwdSO7M,22016
45
+ fmu_manipulation_toolbox/resources/win64/container.dll,sha256=hnRiy7ofyMLZSlD4DrUra67QNN3FVDaxDFOqtPrvX1Y,36864
46
+ fmu_manipulation_toolbox/resources/win64/server_sm.exe,sha256=2NnGROVFQd33k7vPjAf8txybw5kaoVA1gPngdXmTV0g,19456
47
+ fmu_manipulation_toolbox-1.8.2.dev4.dist-info/LICENSE.txt,sha256=c_862mzyk6ownO3Gt6cVs0-53IXLi_-ZEQFNDVabESw,1285
48
+ fmu_manipulation_toolbox-1.8.2.dev4.dist-info/METADATA,sha256=22HV25P8a6eq4X1xxPo0M6OBd5Aoy-eOdGqNW4RyFlc,1068
49
+ fmu_manipulation_toolbox-1.8.2.dev4.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
50
+ fmu_manipulation_toolbox-1.8.2.dev4.dist-info/entry_points.txt,sha256=jCPLMBdS-eOvmRfDv7n0wHZSbJHccHviW03mz5vwO-Q,124
51
+ fmu_manipulation_toolbox-1.8.2.dev4.dist-info/top_level.txt,sha256=9D_h-5BMjSqf9z-XFkbJL_bMppR2XNYW3WNuPkXou0k,25
52
+ fmu_manipulation_toolbox-1.8.2.dev4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.0)
2
+ Generator: setuptools (75.8.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5