[backend] reconstruct repro run, if not in stimuli.dat

This commit is contained in:
Jan Grewe 2020-08-13 15:52:19 +02:00
parent e37d4d5add
commit 1cf7530b48

View File

@ -457,14 +457,7 @@ def scan_folder_for_repros(dataset):
cell_id = (Cells * CellDatasetMap * (Datasets & "dataset_id = '%s'" % dataset["dataset_id"])).fetch("cell_id", limit=1)[0] cell_id = (Cells * CellDatasetMap * (Datasets & "dataset_id = '%s'" % dataset["dataset_id"])).fetch("cell_id", limit=1)[0]
for rs, si in zip(repro_settings, stim_indices): for rs, si in zip(repro_settings, stim_indices):
rp = Repros.get_template_tuple() rp = Repros.get_template_tuple()
path = []
if not find_key_recursive(rs, "run", path):
find_key_recursive(rs, "Run", path)
if len(path) > 0:
rp["run"] = deep_get(rs, path, 0)
else:
rp["run"] = -1
path = [] path = []
if not find_key_recursive(rs, "repro", path): if not find_key_recursive(rs, "repro", path):
find_key_recursive(rs, "RePro", path) find_key_recursive(rs, "RePro", path)
@ -474,7 +467,16 @@ def scan_folder_for_repros(dataset):
if rp["repro_name"] in repro_counts.keys(): if rp["repro_name"] in repro_counts.keys():
repro_counts[rp["repro_name"]] += 1 repro_counts[rp["repro_name"]] += 1
else: else:
repro_counts[rp["repro_name"]] = 1 repro_counts[rp["repro_name"]] = 0
path = []
if not find_key_recursive(rs, "run", path):
find_key_recursive(rs, "Run", path)
if len(path) > 0:
rp["run"] = deep_get(rs, path, 0)
else: # the run information is not there and needs to be fixed!
rp["run"] = repro_counts[rp["repro_name"]]
rp["cell_id"] = cell_id rp["cell_id"] = cell_id
rp["repro_id"] = rp["repro_name"] + str(repro_counts[rp["repro_name"]]) rp["repro_id"] = rp["repro_name"] + str(repro_counts[rp["repro_name"]])
rp["start"] = 0. rp["start"] = 0.