Skip to content

Commit c35328f

Browse files
yt-msMidnighter
authored andcommitted
style: PR feedback
1 parent 63c5b49 commit c35328f

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

src/structurizr/model/deployment_node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
"""Provide a deployment node model."""
1717

18-
from typing import TYPE_CHECKING, Iterable, List, Union
18+
from typing import TYPE_CHECKING, Iterable, List, Optional, Union
1919

2020
from pydantic import Field
2121

@@ -94,7 +94,7 @@ class DeploymentNode(DeploymentElement):
9494
def __init__(
9595
self,
9696
*,
97-
parent: "DeploymentNode" = None,
97+
parent: Optional["DeploymentNode"] = None,
9898
technology: str = "",
9999
instances: int = 1,
100100
children: Iterable["DeploymentNode"] = (),

src/structurizr/model/model.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,26 @@ def __contains__(self, element: Element):
120120
@property
121121
def software_systems(self) -> Set[SoftwareSystem]:
122122
"""Return the software systems in the model."""
123-
return {e for e in self.get_elements() if isinstance(e, SoftwareSystem)}
123+
return {
124+
element
125+
for element in self.get_elements()
126+
if isinstance(element, SoftwareSystem)
127+
}
124128

125129
@property
126130
def people(self) -> Set[Person]:
127131
"""Return the people in the model."""
128-
return {e for e in self.get_elements() if isinstance(e, Person)}
132+
return {
133+
element for element in self.get_elements() if isinstance(element, Person)
134+
}
129135

130136
@property
131137
def deployment_nodes(self) -> Set[DeploymentNode]:
132138
"""Return the *top level* deployment nodes in the model."""
133139
return {
134-
e
135-
for e in self.get_elements()
136-
if isinstance(e, DeploymentNode) and e.parent is None
140+
element
141+
for element in self.get_elements()
142+
if isinstance(element, DeploymentNode) and element.parent is None
137143
}
138144

139145
@classmethod

0 commit comments

Comments
 (0)