Skip to content

Commit 122f399

Browse files
author
Nicolas Laurent
committed
Cosmetic and bump version 1.8.1
1 parent ab590f2 commit 122f399

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ This package was formerly known as `fmutool`.
33

44

55
## Version 1.8.1
6-
*
6+
* FIXED: `fmucontainer` read links from `.json` input files
7+
* CHANGED: switch to PyQT6 and add minor GUI improvements
78

89
## Version 1.8
910
* CHANGE: Package in now known as `fmu_manipulation`

fmu_manipulation_toolbox/assembly.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@ def __init__(self, from_port: Port, to_port: Port):
3131

3232

3333
class AssemblyNode:
34-
def __init__(self, name: Union[str, None], step_size: float = None, mt=False, profiling=False,
34+
def __init__(self, name: Optional[str], step_size: float = None, mt=False, profiling=False,
3535
auto_link=True, auto_input=True, auto_output=True):
3636
self.name = name
3737
if step_size:
3838
try:
3939
self.step_size = float(step_size)
4040
except ValueError:
41-
logger.warning(f"{step_size}")
41+
logger.warning(f"Step size '{step_size}' is incorrect format.")
42+
self.step_size = None
4243
else:
4344
self.step_size = None
4445
self.mt = mt
@@ -47,6 +48,7 @@ def __init__(self, name: Union[str, None], step_size: float = None, mt=False, pr
4748
self.auto_input = auto_input
4849
self.auto_output = auto_output
4950

51+
self.parent: Optional[AssemblyNode] = None
5052
self.children: List[AssemblyNode] = [] # sub-containers
5153
self.fmu_names_list: Set[str] = set() # FMUs contained at this level
5254
self.input_ports: Dict[Port, str] = {}
@@ -59,9 +61,14 @@ def add_sub_node(self, sub_node):
5961
if sub_node.name is None:
6062
sub_node.name = str(uuid.uuid4())+".fmu"
6163

64+
if sub_node.parent is not None:
65+
raise AssemblyError(f"Internal Error: AssemblyNode {sub_node.name} is already parented.")
66+
67+
sub_node.parent = self
6268
self.fmu_names_list.add(sub_node.name)
6369
self.children.append(sub_node)
6470

71+
6572
def add_fmu(self, fmu_name: str):
6673
self.fmu_names_list.add(fmu_name)
6774

fmu_manipulation_toolbox/gui.py

-1
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,6 @@ def __init__(self, *args, **kwargs):
484484

485485
self.setStyleSheet(css_dark)
486486

487-
488487
if os.name == 'nt':
489488
self.setWindowIcon(QIcon(os.path.join(os.path.dirname(__file__), 'resources', 'icon-round.png')))
490489

0 commit comments

Comments
 (0)