Skip to content

Commit 1aebf10

Browse files
committed
Fix prioritization of wash to disp
1 parent 803b8fa commit 1aebf10

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

cellpainter/cellpainter/constraints.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
from typing import *
33
from dataclasses import *
44

5+
import sys
6+
57
from .symbolic import Symbolic
68
from .commands import *
79

@@ -46,7 +48,8 @@ def Opt(cmd: Command) -> Command:
4648
opt = optimal_env(cmd_inst)
4749
ends |= opt.expected_ends
4850
subst |= opt.env
49-
pbutils.pr(opt)
51+
print('... ', end='', file=sys.stderr, flush=True)
52+
# pbutils.pr(opt)
5053
return cmd_inst.resolve(opt.env)
5154
else:
5255
return cmd

cellpainter/cellpainter/protocol.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,14 @@
3838
import pbutils
3939

4040
class OptPrio:
41-
incubation = Min(priority=7, weight=1)
42-
wash_to_disp = Min(priority=6, weight=1)
43-
incu_slack = Min(priority=6, weight=1)
44-
without_lid = Min(priority=4, weight=1)
45-
total_time = Min(priority=3, weight=1)
46-
squeeze_steps = Min(priority=2, weight=1)
47-
inside_incu = Max(priority=1, weight=0)
41+
incubation = Min(priority=8, weight=1)
42+
wash_to_disp = Min(priority=7, weight=1)
43+
total_time = Min(priority=6, weight=1)
44+
without_lid = Min(priority=5, weight=1)
45+
inside_incu = Max(priority=4, weight=1)
46+
squeeze_steps = Min(priority=3, weight=1)
47+
48+
# incu_slack = Min(priority=6, weight=1)
4849

4950
@dataclass(frozen=True)
5051
class Plate:
@@ -535,6 +536,7 @@ def paint_batch(batch: list[Plate], protocol_config: ProtocolConfig) -> Command:
535536
]
536537

537538
post_cmds = [
539+
Duration(f'batch {batch_index}', OptPrio.total_time),
538540
]
539541

540542
chunks: dict[Desc, Iterable[Command]] = {}
@@ -759,7 +761,11 @@ def paint_batch(batch: list[Plate], protocol_config: ProtocolConfig) -> Command:
759761
Fork(
760762
Seq(
761763
*(wash_delay if not step.wash and not step.blue else []),
762-
Duration(f'{plate_desc} transfer {ix}', OptPrio.wash_to_disp),
764+
*(
765+
[Duration(f'{plate_desc} transfer {ix}', OptPrio.wash_to_disp)]
766+
if step.wash or step.blue else
767+
[]
768+
),
763769
DispCmd('RunValidated', step.disp),
764770
Checkpoint(f'{plate_desc} incubation {ix}'),
765771
)

0 commit comments

Comments
 (0)