From 456e64759f4f319e0684501b3c7734b757ea4666 Mon Sep 17 00:00:00 2001 From: Yilun Guan Date: Tue, 28 Nov 2023 10:41:11 -0500 Subject: [PATCH] add source sequence in cal_targets by default --- src/schedlib/policies/sat.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/schedlib/policies/sat.py b/src/schedlib/policies/sat.py index ebb30993..65e2b139 100644 --- a/src/schedlib/policies/sat.py +++ b/src/schedlib/policies/sat.py @@ -134,6 +134,11 @@ def construct_seq(loader_cfg): raise ValueError(f"unknown sequence type: {loader_cfg['type']}") blocks = tu.tree_map(construct_seq, self.blocks, is_leaf=lambda x: isinstance(x, dict) and 'type' in x) + # by default add calibration blocks specified in cal_targets if not already specified + for cal_target in self.cal_targets: + source = cal_target[0] + if source not in blocks['calibration']: + blocks['calibration'][source] = src.source_gen_seq(source, t0, t1) return core.seq_trim(blocks, t0, t1) def apply(self, blocks: core.BlocksTree) -> core.BlocksTree: @@ -235,6 +240,7 @@ def apply(self, blocks: core.BlocksTree) -> core.BlocksTree: ######### # merge # ######### + seq = None for query in self.merge_order[::-1]: match, _ = core.seq_partition_with_query(query, blocks)