diff --git a/TODO.md b/TODO.md index 4153fc3..3c568dc 100644 --- a/TODO.md +++ b/TODO.md @@ -1,14 +1,15 @@ # TODO ## Features -- implement import of non-datalad projects -- implement a way to use another backlog repo as a project +- [ ] implement import of non-datalad projects +- [ ] implement a way to use another backlog repo as a project -- find a way to convey the mathematical structure of what EXACTLY is the form of the correlator in a specific project +- [ ] find a way to convey the mathematical structure of what EXACTLY is the form of the correlator in a specific project - this could e.g. be done along the lines of mandatory documentation -- keep better track of the versions of the code, that was used for a specific measurement. +- [ ] keep better track of the versions the code, that was used for a specific measurement. - maybe let this be an input in the project file? - git repo and commit hash/version tag +- [ ] implement local caching with pickle files ## Bugfixes - [ ] revisit the reimport function for single files diff --git a/corrlib/find.py b/corrlib/find.py index 432bb26..a1b25f9 100644 --- a/corrlib/find.py +++ b/corrlib/find.py @@ -5,7 +5,6 @@ import json import pandas as pd import numpy as np from .input.implementations import codes -from .tools import m2k, k2m # this will implement the search functionality @@ -66,33 +65,11 @@ def sfcf_filter(results, **kwargs): if kwargs.get('offset') != param['offset']: drops.append(ind) continue - if 'quark_kappas' in kwargs: - kappas = kwargs['quark_kappas'] - if (not np.isclose(kappas[0], param['quarks'][0]['mass']) or not np.isclose(kappas[1], param['quarks'][1]['mass'])): + if 'quark_masses' in kwargs: + quark_masses = kwargs['quark_masses'] + if (not np.isclose(quark_masses[0], param['quarks'][0]['mass']) or not np.isclose(quark_masses[1], param['quarks'][1]['mass'])): drops.append(ind) continue - if 'qm1' in kwargs: - quark_mass1 = kwargs['qm1'] - if not isinstance(quark_mass1, list): - if (not np.isclose(quark_mass1, k2m(param['quarks'][0]['mass']))): - drops.append(ind) - continue - else: - if len(quark_mass1) == 2: - if (quark_mass1[0] > k2m(param['quarks'][0]['mass'])) or (quark_mass1[1] < k2m(param['quarks'][0]['mass'])): - drops.append(ind) - continue - if 'qm2' in kwargs: - quark_mass2 = kwargs['qm2'] - if not isinstance(quark_mass2, list): - if (not np.isclose(quark_mass2, k2m(param['quarks'][1]['mass']))): - drops.append(ind) - continue - else: - if len(quark_mass2) == 2: - if (quark_mass2[0] > k2m(param['quarks'][1]['mass'])) or (quark_mass2[1] < k2m(param['quarks'][1]['mass'])): - drops.append(ind) - continue if 'quark_thetas' in kwargs: quark_thetas = kwargs['quark_thetas'] 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']): diff --git a/corrlib/meas_io.py b/corrlib/meas_io.py index 9a3806b..1f1e920 100644 --- a/corrlib/meas_io.py +++ b/corrlib/meas_io.py @@ -139,8 +139,8 @@ def load_records(path: str, meas_paths: list[str], preloaded = {}) -> list[Union returned_data: list = [] for file in needed_data.keys(): for key in list(needed_data[file]): - if os.path.exists(cache_path(path, file, key) + ".p"): - returned_data.append(load_object(cache_path(path, file, key) + ".p")) + if os.path.exists(cache_path(path, file, key)): + returned_data.append(load_object(cache_path(path, file, key))) else: if file not in preloaded: preloaded[file] = preload(path, file) @@ -156,13 +156,13 @@ def cache_dir(path, file): cache_path_list = [path] cache_path_list.append(".cache") cache_path_list.extend(file.split("/")[1:]) - cache_path = "/".join(cache_path_list) + cache_path = os.path.join(cache_path_list) return cache_path def cache_path(path, file, key): cache_path = os.path.join(cache_dir(path, file), key) - return cache_path + return cache_path + ".p" def preload(path: str, file: str): diff --git a/corrlib/tools.py b/corrlib/tools.py index 3ac8bfe..e424b59 100644 --- a/corrlib/tools.py +++ b/corrlib/tools.py @@ -9,10 +9,3 @@ def list2str(mylist): return s cached = True - -def m2k(m): - return 1/(2*m+8) - - -def k2m(k): - return (1/(2*k))-4