Commit a767372a authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

update dispatch_obsgroup_detector: append task only if success

parent b18ad976
......@@ -345,6 +345,7 @@ class Dispatcher:
this_instrument = this_obsgroup_plan_basis["instrument"][0]
effective_detector_names = csst[this_instrument].effective_detector_names
# loop over effective detectors
for this_effective_detector_name in effective_detector_names:
this_task = dict(
dataset=this_obsgroup_plan_basis["dataset"][0],
......@@ -386,24 +387,25 @@ class Dispatcher:
# set n_file_expected and n_file_found
this_task["n_file_expected"] = n_file_expected
this_task["n_file_found"] = n_file_found
# append this task
task_list.append(
dict(
task=this_task,
success=this_success,
relevant_plan=this_obsgroup_plan_basis,
relevant_data=this_obsgroup_detector_found,
n_relevant_plan=len(this_obsgroup_plan_basis),
n_relevant_data=len(this_obsgroup_detector_found),
relevant_data_id_list=(
list(this_obsgroup_detector_found["_id"])
if n_file_found > 0
else []
),
n_file_expected=n_file_expected,
n_file_found=n_file_found,
# append this task if this_success
if this_success:
task_list.append(
dict(
task=this_task,
success=this_success,
relevant_plan=this_obsgroup_plan_basis,
relevant_data=this_obsgroup_detector_found,
n_relevant_plan=len(this_obsgroup_plan_basis),
n_relevant_data=len(this_obsgroup_detector_found),
relevant_data_id_list=(
list(this_obsgroup_detector_found["_id"])
if n_file_found > 0
else []
),
n_file_expected=n_file_expected,
n_file_found=n_file_found,
)
)
)
return task_list
@staticmethod
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment