Skip to content

Commit 46ce0f8

Browse files
committed
modify SubController terminology in docstrings
1 parent 04f6269 commit 46ce0f8

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/fastcs/controller.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def path(self) -> list[str]:
5151

5252
def set_path(self, path: list[str]):
5353
if self._path:
54-
raise ValueError(f"SubController is already registered under {self.path}")
54+
raise ValueError(f"sub controller is already registered under {self.path}")
5555

5656
self._path = path
5757

@@ -101,7 +101,7 @@ class method and a controller instance, so that it can be called from any
101101
def register_sub_controller(self, name: str, sub_controller: Controller):
102102
if name in self.__sub_controller_tree.keys():
103103
raise ValueError(
104-
f"Controller {self} already has a SubController registered as {name}"
104+
f"Controller {self} already has a sub controller registered as {name}"
105105
)
106106

107107
self.__sub_controller_tree[name] = sub_controller
@@ -110,7 +110,7 @@ def register_sub_controller(self, name: str, sub_controller: Controller):
110110
if isinstance(sub_controller.root_attribute, Attribute):
111111
if name in self.attributes:
112112
raise TypeError(
113-
f"Cannot set SubController `{name}` root attribute "
113+
f"Cannot set sub controller `{name}` root attribute "
114114
f"on the parent controller `{type(self).__name__}` "
115115
f"as it already has an attribute of that name."
116116
)

src/fastcs/controller_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
@dataclass
99
class ControllerAPI:
10-
"""Attributes, bound methods and sub APIs of a `Controller` / `SubController`"""
10+
"""Attributes, bound methods and sub APIs of a `Controller`"""
1111

1212
path: list[str] = field(default_factory=list)
1313
"""Path within controller tree (empty if this is the root)"""

tests/assertable_controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def _assert_method(self, path: list[str], method: Literal["get", "process", ""])
110110
"""
111111
queue = copy.deepcopy(path)
112112

113-
# Navigate to subcontroller
113+
# Navigate to sub controller
114114
controller_api = self
115115
item_name = queue.pop(-1)
116116
for item in queue:

tests/test_controller.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ def test_controller_nesting():
1919
assert sub_controller.get_sub_controllers() == {"b": sub_sub_controller}
2020

2121
with pytest.raises(
22-
ValueError, match=r"Controller .* already has a SubController registered as .*"
22+
ValueError, match=r"Controller .* already has a sub controller registered as .*"
2323
):
2424
controller.register_sub_controller("a", Controller())
2525

2626
with pytest.raises(
27-
ValueError, match=r"SubController is already registered under .*"
27+
ValueError, match=r"sub controller is already registered under .*"
2828
):
2929
controller.register_sub_controller("c", sub_controller)
3030

@@ -106,7 +106,7 @@ class FailingController(SomeController):
106106
with pytest.raises(
107107
TypeError,
108108
match=(
109-
"Cannot set SubController `sub_controller` root attribute "
109+
"Cannot set sub controller `sub_controller` root attribute "
110110
"on the parent controller `FailingController` as it already "
111111
"has an attribute of that name."
112112
),

0 commit comments

Comments
 (0)