Skip to content

Commit 1c2a00b

Browse files
author
Pharmbio
committed
Fix test circuit
1 parent c23b51c commit 1c2a00b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cellpainter/cellpainter/commands.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def F(cmd: Command):
9393
return cmd
9494
return self.transform(F), did_transform
9595

96-
def collect(self: Command) -> list[tuple[Command, Metadata]]:
96+
def collect(self: Command, flatten_sections: bool=False) -> list[tuple[Command, Metadata]]:
9797
match self:
9898
case SeqCmd():
9999
return [
@@ -106,6 +106,8 @@ def collect(self: Command) -> list[tuple[Command, Metadata]]:
106106
(collected_cmd, collected_metadata.merge(self.metadata))
107107
for collected_cmd, collected_metadata in self.command.collect()
108108
]
109+
case OptimizeSection() if flatten_sections:
110+
return self.command.collect()
109111
# case OptimizeSection():
110112
# raise ValueError(f'collect({self})')
111113
case _:

cellpainter/cellpainter/small_protocols.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def test_circuit(args: SmallProtocolArgs):
172172
cmds = Seq(
173173
*[
174174
cmd.add(metadata)
175-
for cmd, metadata in cmds.collect()
175+
for cmd, metadata in cmds.collect(flatten_sections=True)
176176
if isinstance(cmd, RobotarmCmd)
177177
# if metadata.step not in {'Triton', 'Stains'}
178178
],

0 commit comments

Comments
 (0)