Skip to content

Commit d4afc17

Browse files
committed
Remove debugging and commented code
1 parent f8d2413 commit d4afc17

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

src/dodal/beamlines/adsim.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,5 @@ def det(path_provider: PathProvider) -> SimDetector:
9090

9191
@devices.v1_init(factory=EpicsMotor, prefix=f"{PREFIX.beamline_prefix}-MO-SIMC-01:M1")
9292
def old_motor(motor: EpicsMotor):
93-
print(f"Built {motor}")
93+
# arbitrary post-init configuration
94+
motor.settle_time = 12

src/dodal/device_manager.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ def __init__(
6363
provided: Mapping[str, Any] | None,
6464
factories: Mapping[str, Callable[[], Any]],
6565
):
66-
self.ready = dict(provided or {})
6766
# wrap to prevent modification escaping
67+
self.ready = dict(provided or {})
6868
# drop duplicate keys so the len and iter methods are easier
6969
self.lazy = {k: v for k, v in factories.items() if k not in self.ready}
7070

@@ -166,7 +166,6 @@ def build(
166166
)
167167
if devices.errors:
168168
# TODO: NotBuilt?
169-
print(devices.errors)
170169
raise Exception("??? build")
171170
else:
172171
if connect_immediately:
@@ -286,7 +285,6 @@ def build(self, mock: bool = False, fixtures: dict[str, Any] | None = None) -> V
286285
)
287286
if devices.errors:
288287
# TODO: NotBuilt?
289-
print(devices.errors)
290288
raise Exception("??? build")
291289
else:
292290
device = devices.devices[self.name].device
@@ -366,7 +364,6 @@ def fixture(self, func: Callable[[], T]) -> Callable[[], T]:
366364
def v1_init(
367365
self,
368366
factory: type[V1],
369-
# name: str,
370367
prefix: str,
371368
mock: bool = False,
372369
skip: SkipType = False,
@@ -479,10 +476,7 @@ def build_devices(
479476
f"Factories ({common}) will be overridden by fixtures", stacklevel=1
480477
)
481478
factories = tuple(f for f in factories if f.name not in common)
482-
# if unknown := {f for f in factories if f not in self._factories.values()}:
483-
# raise ValueError(f"Factories ({unknown}) are unknown to this manager")
484479
build_list = self._expand_dependencies(factories, fixtures)
485-
# print(build_list)
486480
order = self._build_order(
487481
{dep: self[dep] for dep in build_list}, fixtures=fixtures
488482
)
@@ -544,13 +538,10 @@ def _expand_dependencies(
544538
dependencies = set()
545539
factories = set(factories)
546540
while factories:
547-
# print(dependencies)
548541
fact = factories.pop()
549542
dependencies.add(fact.name)
550543
options = fact.optional_dependencies
551-
# print(f" {fact.name}")
552544
for dep in fact.dependencies:
553-
# print(f" {dep}")
554545
if dep not in dependencies and dep not in available_fixtures:
555546
if dep in self._factories:
556547
factories.add(self[dep])

0 commit comments

Comments
 (0)