From 67bbc25321c447663b9990c1f5e0305d6901e7c8 Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Tue, 8 Apr 2025 13:03:41 +0000 Subject: [PATCH] debug result filter, with a first simple fix, better fix needed --- corrlib/find.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/corrlib/find.py b/corrlib/find.py index 4aeb542..0daf9f3 100644 --- a/corrlib/find.py +++ b/corrlib/find.py @@ -73,14 +73,15 @@ def filter_results(results, **kwargs): if (quark_thetas[0] != param['quarks'][0]['thetas'] and quark_thetas[1] != param['quarks'][1]['thetas']) or (quark_thetas[0] != param['quarks'][1]['thetas'] and quark_thetas[1] != param['quarks'][0]['thetas']): drops.append(ind) continue + # careful, this is not save, when multiple contributions are present! if 'wf1' in kwargs: wf1 = kwargs['wf1'] - if (wf1[0] != param['wf1'][0]) or (wf1[1][0] != param['wf1'][1][0]) or (wf1[1][1] != param['wf1'][1][1]): + if (wf1[0][0] != param['wf1'][0][0]) or (wf1[0][1][0] != param['wf1'][0][1][0]) or (wf1[0][1][1] != param['wf1'][0][1][1]): drops.append(ind) continue if 'wf2' in kwargs: wf2 = kwargs['wf2'] - if (wf2[0] != param['wf2'][0]) or (wf2[1][0] != param['wf2'][1][0]) or (wf2[1][1] != param['wf2'][1][1]): + if (wf2[0][0] != param['wf2'][0][0]) or (wf2[0][1][0] != param['wf2'][0][1][0]) or (wf2[0][1][1] != param['wf2'][0][1][1]): drops.append(ind) continue @@ -91,7 +92,7 @@ def find_record(path, ensemble, correlator_name, project=None, code=None, parame db = path + '/backlogger.db' if os.path.exists(db): dl.get(db, dataset=path) - results = _db_lookup(db, ensemble, correlator_name, project, code=None, parameters=None, created_before=created_before, created_after=created_after, updated_before=updated_before, updated_after=updated_after, revision=revision) + results = _db_lookup(db, ensemble, correlator_name, project, code=code, parameters=parameters, created_before=created_before, created_after=created_after, updated_before=updated_before, updated_after=updated_after, revision=revision) results = filter_results(results, **kwargs) print("Found " + str(len(results)) + " results") return results.reset_index()