From 875d7b9461ef9b763853e435c24d1fe2ed3d036c Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Mon, 23 Feb 2026 09:45:00 +0100 Subject: [PATCH 01/27] write explicit setup-uv link --- .github/workflows/mypy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mypy.yaml b/.github/workflows/mypy.yaml index 791243f..a75fa57 100644 --- a/.github/workflows/mypy.yaml +++ b/.github/workflows/mypy.yaml @@ -20,7 +20,7 @@ jobs: with: show-progress: true - name: Install uv - uses: astral-sh/setup-uv@v7 + uses: https://github.com/astral-sh/setup-uv@v7 with: python-version: ${{ matrix.python-version }} enable-cache: true From 540160c51f4c998341b6441f984d8e7b0bfdc2fd Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Tue, 24 Feb 2026 09:14:12 +0100 Subject: [PATCH 02/27] use older setup-uv action --- .github/workflows/mypy.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mypy.yaml b/.github/workflows/mypy.yaml index a75fa57..0add4e9 100644 --- a/.github/workflows/mypy.yaml +++ b/.github/workflows/mypy.yaml @@ -14,13 +14,13 @@ jobs: - name: Install git-annex run: | sudo apt-get update - sudo apt-get install -y git-annex + sudo apt-get install -y git-annex - name: Check out the repository uses: https://github.com/RouxAntoine/checkout@v4.1.8 with: show-progress: true - name: Install uv - uses: https://github.com/astral-sh/setup-uv@v7 + uses: https://github.com/astral-sh/setup-uv@v6 with: python-version: ${{ matrix.python-version }} enable-cache: true From 373f3476c070c0ff116f5a29f51c068a099a36f2 Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Tue, 24 Feb 2026 09:18:51 +0100 Subject: [PATCH 03/27] explicit install-uv version --- .github/workflows/mypy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mypy.yaml b/.github/workflows/mypy.yaml index 0add4e9..c2a36c4 100644 --- a/.github/workflows/mypy.yaml +++ b/.github/workflows/mypy.yaml @@ -20,7 +20,7 @@ jobs: with: show-progress: true - name: Install uv - uses: https://github.com/astral-sh/setup-uv@v6 + uses: https://github.com/astral-sh/setup-uv@v6.8.0 with: python-version: ${{ matrix.python-version }} enable-cache: true From b2ac8939a33087260a74d375b97a040d8c40640f Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Fri, 27 Feb 2026 11:20:28 +0100 Subject: [PATCH 04/27] fix: cli show stat failed for single values --- corrlib/cli.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/corrlib/cli.py b/corrlib/cli.py index f205026..5ceb5e3 100644 --- a/corrlib/cli.py +++ b/corrlib/cli.py @@ -9,6 +9,7 @@ from .main import update_aliases from .meas_io import drop_cache as mio_drop_cache from .meas_io import load_record as mio_load_record import os +from pyerrors import Corr from importlib.metadata import version @@ -120,12 +121,14 @@ def stat( "--dataset", "-d", ), - record: str = typer.Argument(), + record_id: str = typer.Argument(), ) -> None: """ Show the statistics of a given record. """ - record = mio_load_record(path, record)[0] + record = mio_load_record(path, record_id) + if isinstance(record, Corr): + record = record[0] statistics = record.idl print(statistics) return From b51a69bc69b4d634e43adcf86f54fcc3e5201a98 Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Fri, 6 Mar 2026 15:35:49 +0100 Subject: [PATCH 05/27] fix file unlock --- corrlib/tracker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/corrlib/tracker.py b/corrlib/tracker.py index 5cc281c..e535b03 100644 --- a/corrlib/tracker.py +++ b/corrlib/tracker.py @@ -114,7 +114,7 @@ def unlock(path: str, file: str) -> None: """ tracker = get_tracker(path) if tracker == 'datalad': - dl.unlock(file, dataset=path) + dl.unlock(os.path.join(path, file), dataset=path) elif tracker == 'None': Warning("Tracker 'None' does not implement unlock.") pass From 6b2db911bf7ee11e19f442e425a9ee48c28e3969 Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Fri, 20 Mar 2026 12:56:27 +0100 Subject: [PATCH 06/27] add list for stat types --- corrlib/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/corrlib/cli.py b/corrlib/cli.py index 5ceb5e3..4e1b65e 100644 --- a/corrlib/cli.py +++ b/corrlib/cli.py @@ -39,7 +39,7 @@ def update( @app.command() -def list( +def lister( path: str = typer.Option( str('./corrlib'), "--dataset", @@ -127,7 +127,7 @@ def stat( Show the statistics of a given record. """ record = mio_load_record(path, record_id) - if isinstance(record, Corr): + if isinstance(record, (list, Corr)): record = record[0] statistics = record.idl print(statistics) From a9cc2b3f48199877eedd40f87db27dffe0a73251 Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Fri, 20 Mar 2026 12:57:48 +0100 Subject: [PATCH 07/27] fix write measurement call and reporting to user --- corrlib/toml.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/corrlib/toml.py b/corrlib/toml.py index 629a499..feafaf6 100644 --- a/corrlib/toml.py +++ b/corrlib/toml.py @@ -189,7 +189,6 @@ def import_toml(path: str, file: str, copy_file: bool=True) -> None: measurement = sfcf.read_data(path, uuid, md['path'], md['prefix'], param, version=md['version'], cfg_seperator=md['cfg_seperator'], sep='/') - print(mname + " imported.") elif project['code'] == 'openQCD': if md['measurement'] == 'ms1': param = openQCD.read_ms1_param(path, uuid, md['param_file']) @@ -211,8 +210,8 @@ def import_toml(path: str, file: str, copy_file: bool=True) -> None: param['type'] = 't1' measurement = openQCD.extract_t1(path, uuid, md['path'], param, str(md["prefix"]), int(md["dtr_read"]), int(md["xmin"]), int(md["spatial_extent"]), fit_range=int(md.get('fit_range', 5)), postfix=str(md.get('postfix', '')), names=md.get('names', []), files=md.get('files', [])) - - write_measurement(path, ensemble, measurement, uuid, project['code'], (md['param_file'] if 'param_file' in md else '')) + write_measurement(path, ensemble, measurement, uuid, project['code'], (md['param_file'] if 'param_file' in md else None)) + print(mname + " imported.") if not os.path.exists(os.path.join(path, "toml_imports", uuid)): os.makedirs(os.path.join(path, "toml_imports", uuid)) From 96731baeb9e9db0c5002c1cdbc3ca1dfb75ca52b Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Fri, 20 Mar 2026 12:59:04 +0100 Subject: [PATCH 08/27] fix when files are unlocked or saved --- corrlib/meas_io.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/corrlib/meas_io.py b/corrlib/meas_io.py index 65a0569..300adc3 100644 --- a/corrlib/meas_io.py +++ b/corrlib/meas_io.py @@ -34,22 +34,28 @@ def write_measurement(path: str, ensemble: str, measurement: dict[str, dict[str, """ db_file = get_db_file(path) db = os.path.join(path, db_file) + + files_to_save = [] + get(path, db_file) unlock(path, db_file) + files_to_save.append(db_file) + conn = sqlite3.connect(db) c = conn.cursor() - files = [] for corr in measurement.keys(): file_in_archive = os.path.join('.', 'archive', ensemble, corr, uuid + '.json.gz') file = os.path.join(path, file_in_archive) - files.append(file) known_meas = {} if not os.path.exists(os.path.join(path, '.', 'archive', ensemble, corr)): os.makedirs(os.path.join(path, '.', 'archive', ensemble, corr)) + files_to_save.append(file_in_archive) else: if os.path.exists(file): - unlock(path, file_in_archive) - known_meas = pj.load_json_dict(file) + if file not in files_to_save: + unlock(path, file_in_archive) + files_to_save.append(file_in_archive) + known_meas = pj.load_json_dict(file, verbose=False) if code == "sfcf": parameters = sfcf.read_param(path, uuid, parameter_file) pars = {} @@ -98,9 +104,8 @@ def write_measurement(path: str, ensemble: str, measurement: dict[str, dict[str, (corr, ensemble, code, meas_path, uuid, pars[subkey], parameter_file)) conn.commit() pj.dump_dict_to_json(known_meas, file) - files.append(os.path.join(path, db_file)) conn.close() - save(path, message="Add measurements to database", files=files) + save(path, message="Add measurements to database", files=files_to_save) return From 52f6b0f53c558ad86635111502bee39a525d50fc Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Fri, 20 Mar 2026 13:00:30 +0100 Subject: [PATCH 09/27] silence readers --- corrlib/input/sfcf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/corrlib/input/sfcf.py b/corrlib/input/sfcf.py index 621f736..8b6e1a3 100644 --- a/corrlib/input/sfcf.py +++ b/corrlib/input/sfcf.py @@ -320,10 +320,10 @@ def read_data(path: str, project: str, dir_in_project: str, prefix: str, param: if not param['crr'] == []: if names is not None: data_crr = pe.input.sfcf.read_sfcf_multi(directory, prefix, param['crr'], param['mrr'], corr_type_list, range(len(param['wf_offsets'])), - range(len(param['wf_basis'])), range(len(param['wf_basis'])), version, cfg_seperator, keyed_out=True, names=names) + range(len(param['wf_basis'])), range(len(param['wf_basis'])), version, cfg_seperator, keyed_out=True, silent=True, names=names) else: data_crr = pe.input.sfcf.read_sfcf_multi(directory, prefix, param['crr'], param['mrr'], corr_type_list, range(len(param['wf_offsets'])), - range(len(param['wf_basis'])), range(len(param['wf_basis'])), version, cfg_seperator, keyed_out=True) + range(len(param['wf_basis'])), range(len(param['wf_basis'])), version, cfg_seperator, keyed_out=True, silent=True) for key in data_crr.keys(): data[key] = data_crr[key] From 54b42040a9144033ca9b7aec7d7edfe38057e0e6 Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Fri, 20 Mar 2026 15:07:54 +0100 Subject: [PATCH 10/27] use v6 of astral action --- .github/workflows/pytest.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index 1fcb8fe..c82f6d1 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -29,7 +29,7 @@ jobs: with: show-progress: true - name: Install uv - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@v6 with: python-version: ${{ matrix.python-version }} enable-cache: true From 0e0153bd1d6a96f18b81cfc20398d12c5466c831 Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Fri, 20 Mar 2026 15:23:49 +0100 Subject: [PATCH 11/27] update uv setup after runner upate --- .github/workflows/pytest.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index c82f6d1..0ae798d 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -29,7 +29,7 @@ jobs: with: show-progress: true - name: Install uv - uses: astral-sh/setup-uv@v6 + uses: https://github.com/astral-sh/setup-uv@v7.6.0 with: python-version: ${{ matrix.python-version }} enable-cache: true From ca2eb081bb63c3d682d79a11026d6d2a75aad98e Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Fri, 20 Mar 2026 15:29:34 +0100 Subject: [PATCH 12/27] older version again --- .github/workflows/pytest.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index 0ae798d..6552286 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -29,7 +29,7 @@ jobs: with: show-progress: true - name: Install uv - uses: https://github.com/astral-sh/setup-uv@v7.6.0 + uses: https://github.com/astral-sh/setup-uv@v6 with: python-version: ${{ matrix.python-version }} enable-cache: true From 67a9e4ea4b3d15036c1455a62e60c68a95fcd3ce Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Fri, 20 Mar 2026 15:31:03 +0100 Subject: [PATCH 13/27] use 6.4.0 --- .github/workflows/pytest.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index 6552286..82e7484 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -29,7 +29,7 @@ jobs: with: show-progress: true - name: Install uv - uses: https://github.com/astral-sh/setup-uv@v6 + uses: https://github.com/astral-sh/setup-uv@v6.4.0 with: python-version: ${{ matrix.python-version }} enable-cache: true From 53067f7c476be759230001949689c8bd04833b86 Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Fri, 20 Mar 2026 15:47:02 +0100 Subject: [PATCH 14/27] use v5 --- .github/workflows/pytest.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index 82e7484..9c82795 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -29,10 +29,9 @@ jobs: with: show-progress: true - name: Install uv - uses: https://github.com/astral-sh/setup-uv@v6.4.0 + uses: https://github.com/astral-sh/setup-uv@v5 with: python-version: ${{ matrix.python-version }} - enable-cache: true - name: Install corrlib run: uv sync --locked --all-extras --dev --python ${{ matrix.python-version }} - name: Run tests From 4a821006ed3a38574f3f188f35d55bd5862aa558 Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Fri, 20 Mar 2026 15:49:35 +0100 Subject: [PATCH 15/27] add setup python --- .github/workflows/pytest.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index 9c82795..cd5c0c9 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -28,6 +28,10 @@ jobs: uses: https://github.com/RouxAntoine/checkout@v4.1.8 with: show-progress: true + - name: Setup python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} - name: Install uv uses: https://github.com/astral-sh/setup-uv@v5 with: From f05caf572dca93d8f5b0758b9b5837716146500b Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Fri, 20 Mar 2026 15:52:57 +0100 Subject: [PATCH 16/27] roll out changes --- .github/workflows/mypy.yaml | 7 ++++--- .github/workflows/pytest.yaml | 4 +--- .github/workflows/ruff.yaml | 8 +++++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/mypy.yaml b/.github/workflows/mypy.yaml index c2a36c4..b8ab802 100644 --- a/.github/workflows/mypy.yaml +++ b/.github/workflows/mypy.yaml @@ -19,11 +19,12 @@ jobs: uses: https://github.com/RouxAntoine/checkout@v4.1.8 with: show-progress: true - - name: Install uv - uses: https://github.com/astral-sh/setup-uv@v6.8.0 + - name: Setup python + uses: https://github.com/actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - enable-cache: true + - name: Install uv + uses: https://github.com/astral-sh/setup-uv@v5 - name: Install corrlib run: uv sync --locked --all-extras --dev --python "3.12" - name: Run tests diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index cd5c0c9..af3b667 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -29,13 +29,11 @@ jobs: with: show-progress: true - name: Setup python - uses: actions/setup-python@v5 + uses: https://github.com/actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install uv uses: https://github.com/astral-sh/setup-uv@v5 - with: - python-version: ${{ matrix.python-version }} - name: Install corrlib run: uv sync --locked --all-extras --dev --python ${{ matrix.python-version }} - name: Run tests diff --git a/.github/workflows/ruff.yaml b/.github/workflows/ruff.yaml index 4de4b0b..778743b 100644 --- a/.github/workflows/ruff.yaml +++ b/.github/workflows/ruff.yaml @@ -20,10 +20,12 @@ jobs: uses: https://github.com/RouxAntoine/checkout@v4.1.8 with: show-progress: true - - name: Install uv - uses: astral-sh/setup-uv@v7 + - name: Setup python + uses: https://github.com/actions/setup-python@v5 with: - enable-cache: true + python-version: ${{ matrix.python-version }} + - name: Install uv + uses: https://github.com/astral-sh/setup-uv@v5 - name: Install corrlib run: uv sync --locked --all-extras --dev --python "3.12" - name: Run tests From 0c01d18ecbfac610ef650659f9ebbcf8d352c605 Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Fri, 20 Mar 2026 15:56:31 +0100 Subject: [PATCH 17/27] use python 3.12 for mypy and ruff --- .github/workflows/mypy.yaml | 2 +- .github/workflows/ruff.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mypy.yaml b/.github/workflows/mypy.yaml index b8ab802..4781688 100644 --- a/.github/workflows/mypy.yaml +++ b/.github/workflows/mypy.yaml @@ -22,7 +22,7 @@ jobs: - name: Setup python uses: https://github.com/actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: "3.12" - name: Install uv uses: https://github.com/astral-sh/setup-uv@v5 - name: Install corrlib diff --git a/.github/workflows/ruff.yaml b/.github/workflows/ruff.yaml index 778743b..e0db1b0 100644 --- a/.github/workflows/ruff.yaml +++ b/.github/workflows/ruff.yaml @@ -23,7 +23,7 @@ jobs: - name: Setup python uses: https://github.com/actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: "3.12" - name: Install uv uses: https://github.com/astral-sh/setup-uv@v5 - name: Install corrlib From 4853c0e414959973721ef0d5a849f6214e950502 Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Fri, 20 Mar 2026 15:58:33 +0100 Subject: [PATCH 18/27] fix type error for now --- corrlib/meas_io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/corrlib/meas_io.py b/corrlib/meas_io.py index 300adc3..2a8c986 100644 --- a/corrlib/meas_io.py +++ b/corrlib/meas_io.py @@ -12,7 +12,7 @@ import shutil from typing import Any -def write_measurement(path: str, ensemble: str, measurement: dict[str, dict[str, dict[str, Any]]], uuid: str, code: str, parameter_file: str) -> None: +def write_measurement(path: str, ensemble: str, measurement: dict[str, dict[str, dict[str, Any]]], uuid: str, code: str, parameter_file: Union(Any, None)) -> None: """ Write a measurement to the backlog. If the file for the measurement already exists, update the measurement. From 7ce9742ed562c0f9924ca1ea710c85f7bcec9eaa Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Fri, 20 Mar 2026 15:59:45 +0100 Subject: [PATCH 19/27] fix invalid escape in docs --- corrlib/find.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/corrlib/find.py b/corrlib/find.py index 21063ec..022a3f5 100644 --- a/corrlib/find.py +++ b/corrlib/find.py @@ -119,7 +119,7 @@ def _db_lookup(db: str, ensemble: str, correlator_name: str, code: str, project: def sfcf_filter(results: pd.DataFrame, **kwargs: Any) -> pd.DataFrame: - """ + r""" Filter method for the Database entries holding SFCF calculations. Parameters From d302ae7e0d40397ba90bef4015a7c0f718237031 Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Fri, 20 Mar 2026 16:01:59 +0100 Subject: [PATCH 20/27] fix typo in type annotations --- corrlib/meas_io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/corrlib/meas_io.py b/corrlib/meas_io.py index 2a8c986..2f08052 100644 --- a/corrlib/meas_io.py +++ b/corrlib/meas_io.py @@ -12,7 +12,7 @@ import shutil from typing import Any -def write_measurement(path: str, ensemble: str, measurement: dict[str, dict[str, dict[str, Any]]], uuid: str, code: str, parameter_file: Union(Any, None)) -> None: +def write_measurement(path: str, ensemble: str, measurement: dict[str, dict[str, dict[str, Any]]], uuid: str, code: str, parameter_file: Union[Any, None]) -> None: """ Write a measurement to the backlog. If the file for the measurement already exists, update the measurement. From bd581c6c126bc7ada966e754b2a25cc84fb941b2 Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Fri, 20 Mar 2026 16:07:57 +0100 Subject: [PATCH 21/27] set up git --- .github/workflows/pytest.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index af3b667..83e88ae 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -20,6 +20,10 @@ jobs: env: UV_CACHE_DIR: /tmp/.uv-cache steps: + - name: Setup git + run: | + git config --global user.email "tester@example.com" + git config --global user.name "Tester" - name: Install git-annex run: | sudo apt-get update From c6f3603fbf36f93d9201fc538de3255c505a0629 Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Fri, 20 Mar 2026 16:12:57 +0100 Subject: [PATCH 22/27] Throw errors when parmeter file is not set --- corrlib/meas_io.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/corrlib/meas_io.py b/corrlib/meas_io.py index 2f08052..8e5855d 100644 --- a/corrlib/meas_io.py +++ b/corrlib/meas_io.py @@ -12,7 +12,7 @@ import shutil from typing import Any -def write_measurement(path: str, ensemble: str, measurement: dict[str, dict[str, dict[str, Any]]], uuid: str, code: str, parameter_file: Union[Any, None]) -> None: +def write_measurement(path: str, ensemble: str, measurement: dict[str, dict[str, dict[str, Any]]], uuid: str, code: str, parameter_file: Union[str, None]) -> None: """ Write a measurement to the backlog. If the file for the measurement already exists, update the measurement. @@ -57,7 +57,10 @@ def write_measurement(path: str, ensemble: str, measurement: dict[str, dict[str, files_to_save.append(file_in_archive) known_meas = pj.load_json_dict(file, verbose=False) if code == "sfcf": - parameters = sfcf.read_param(path, uuid, parameter_file) + if parameter_file is not None: + parameters = sfcf.read_param(path, uuid, parameter_file) + else: + raise Exception("Need parameter file for this code!") pars = {} subkeys = list(measurement[corr].keys()) for subkey in subkeys: @@ -66,7 +69,10 @@ def write_measurement(path: str, ensemble: str, measurement: dict[str, dict[str, elif code == "openQCD": ms_type = list(measurement.keys())[0] if ms_type == 'ms1': - parameters = openQCD.read_ms1_param(path, uuid, parameter_file) + if parameter_file is not None: + parameters = openQCD.read_ms1_param(path, uuid, parameter_file) + else: + raise Exception("Need parameter file for this code!") pars = {} subkeys = [] for i in range(len(parameters["rw_fcts"])): From 6cfa51f878c358730effaa58174daba7fe290818 Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Fri, 20 Mar 2026 16:42:55 +0100 Subject: [PATCH 23/27] setup local cache --- .github/workflows/mypy.yaml | 5 ++++- .github/workflows/pytest.yaml | 6 +++++- .github/workflows/ruff.yaml | 5 ++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mypy.yaml b/.github/workflows/mypy.yaml index 4781688..8e276d4 100644 --- a/.github/workflows/mypy.yaml +++ b/.github/workflows/mypy.yaml @@ -9,7 +9,10 @@ jobs: mypy: runs-on: ubuntu-latest env: - UV_CACHE_DIR: /tmp/.uv-cache + UV_CACHE_DIR: ${HOME}/.runner_cache/uv_cache + RUNNER_TOOL_CACHE: ${HOME}/.runner_cache/tool_cache + AGENT_TOOLSDIRECTORY: ${HOME}/.runner_cache/tool_dir + RUN_TOOL_CACHE: ${HOME}/.runner_cache/run_tool_cache steps: - name: Install git-annex run: | diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index 83e88ae..3411646 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -18,7 +18,10 @@ jobs: runs-on: ubuntu-latest env: - UV_CACHE_DIR: /tmp/.uv-cache + UV_CACHE_DIR: ${HOME}/.runner_cache/uv_cache + RUNNER_TOOL_CACHE: ${HOME}/.runner_cache/tool_cache + AGENT_TOOLSDIRECTORY: ${HOME}/.runner_cache/tool_dir + RUN_TOOL_CACHE: ${HOME}/.runner_cache/run_tool_cache steps: - name: Setup git run: | @@ -36,6 +39,7 @@ jobs: uses: https://github.com/actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + cache: 'pip' - name: Install uv uses: https://github.com/astral-sh/setup-uv@v5 - name: Install corrlib diff --git a/.github/workflows/ruff.yaml b/.github/workflows/ruff.yaml index e0db1b0..db42edb 100644 --- a/.github/workflows/ruff.yaml +++ b/.github/workflows/ruff.yaml @@ -10,7 +10,10 @@ jobs: runs-on: ubuntu-latest env: - UV_CACHE_DIR: /tmp/.uv-cache + UV_CACHE_DIR: ${HOME}/.runner_cache/uv_cache + RUNNER_TOOL_CACHE: ${HOME}/.runner_cache/tool_cache + AGENT_TOOLSDIRECTORY: ${HOME}/.runner_cache/tool_dir + RUN_TOOL_CACHE: ${HOME}/.runner_cache/run_tool_cache steps: - name: Install git-annex run: | From 94b677262a239f483f673fae2f7abf3e0f3e707c Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Fri, 20 Mar 2026 16:45:01 +0100 Subject: [PATCH 24/27] remove cache envs --- .github/workflows/mypy.yaml | 3 --- .github/workflows/pytest.yaml | 3 --- .github/workflows/ruff.yaml | 3 --- 3 files changed, 9 deletions(-) diff --git a/.github/workflows/mypy.yaml b/.github/workflows/mypy.yaml index 8e276d4..fdb5bee 100644 --- a/.github/workflows/mypy.yaml +++ b/.github/workflows/mypy.yaml @@ -10,9 +10,6 @@ jobs: runs-on: ubuntu-latest env: UV_CACHE_DIR: ${HOME}/.runner_cache/uv_cache - RUNNER_TOOL_CACHE: ${HOME}/.runner_cache/tool_cache - AGENT_TOOLSDIRECTORY: ${HOME}/.runner_cache/tool_dir - RUN_TOOL_CACHE: ${HOME}/.runner_cache/run_tool_cache steps: - name: Install git-annex run: | diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index 3411646..286afbe 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -19,9 +19,6 @@ jobs: runs-on: ubuntu-latest env: UV_CACHE_DIR: ${HOME}/.runner_cache/uv_cache - RUNNER_TOOL_CACHE: ${HOME}/.runner_cache/tool_cache - AGENT_TOOLSDIRECTORY: ${HOME}/.runner_cache/tool_dir - RUN_TOOL_CACHE: ${HOME}/.runner_cache/run_tool_cache steps: - name: Setup git run: | diff --git a/.github/workflows/ruff.yaml b/.github/workflows/ruff.yaml index db42edb..a1cb972 100644 --- a/.github/workflows/ruff.yaml +++ b/.github/workflows/ruff.yaml @@ -11,9 +11,6 @@ jobs: runs-on: ubuntu-latest env: UV_CACHE_DIR: ${HOME}/.runner_cache/uv_cache - RUNNER_TOOL_CACHE: ${HOME}/.runner_cache/tool_cache - AGENT_TOOLSDIRECTORY: ${HOME}/.runner_cache/tool_dir - RUN_TOOL_CACHE: ${HOME}/.runner_cache/run_tool_cache steps: - name: Install git-annex run: | From c2296f00ee84eef8fabe20d99aae52c890736ea4 Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Fri, 20 Mar 2026 16:47:36 +0100 Subject: [PATCH 25/27] remove uv cache --- .github/workflows/mypy.yaml | 2 -- .github/workflows/pytest.yaml | 2 -- .github/workflows/ruff.yaml | 2 -- 3 files changed, 6 deletions(-) diff --git a/.github/workflows/mypy.yaml b/.github/workflows/mypy.yaml index fdb5bee..fbd51ec 100644 --- a/.github/workflows/mypy.yaml +++ b/.github/workflows/mypy.yaml @@ -8,8 +8,6 @@ on: jobs: mypy: runs-on: ubuntu-latest - env: - UV_CACHE_DIR: ${HOME}/.runner_cache/uv_cache steps: - name: Install git-annex run: | diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index 286afbe..da44258 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -17,8 +17,6 @@ jobs: - "3.14" runs-on: ubuntu-latest - env: - UV_CACHE_DIR: ${HOME}/.runner_cache/uv_cache steps: - name: Setup git run: | diff --git a/.github/workflows/ruff.yaml b/.github/workflows/ruff.yaml index a1cb972..1da1225 100644 --- a/.github/workflows/ruff.yaml +++ b/.github/workflows/ruff.yaml @@ -9,8 +9,6 @@ jobs: ruff: runs-on: ubuntu-latest - env: - UV_CACHE_DIR: ${HOME}/.runner_cache/uv_cache steps: - name: Install git-annex run: | From a5d6b978ea5d4b642828f220cd2c2b07772af089 Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Fri, 20 Mar 2026 17:25:44 +0100 Subject: [PATCH 26/27] remove pip cache --- .github/workflows/pytest.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index da44258..b1a4d94 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -34,7 +34,6 @@ jobs: uses: https://github.com/actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - cache: 'pip' - name: Install uv uses: https://github.com/astral-sh/setup-uv@v5 - name: Install corrlib From b65ee83698df8f8f292670e4aea4565f0595150d Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Fri, 20 Mar 2026 23:37:40 +0100 Subject: [PATCH 27/27] fix list test --- tests/cli_test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/cli_test.py b/tests/cli_test.py index a6b0bd7..d4a4045 100644 --- a/tests/cli_test.py +++ b/tests/cli_test.py @@ -37,7 +37,7 @@ def test_init_db(tmp_path): table_names = [table[0] for table in tables] for expected_table in expected_tables: assert expected_table in table_names - + cursor.execute("SELECT * FROM projects;") projects = cursor.fetchall() assert len(projects) == 0 @@ -60,7 +60,7 @@ def test_init_db(tmp_path): project_column_names = [col[1] for col in project_columns] for expected_col in expected_project_columns: assert expected_col in project_column_names - + cursor.execute("PRAGMA table_info('backlogs');") backlog_columns = cursor.fetchall() expected_backlog_columns = [ @@ -85,7 +85,7 @@ def test_list(tmp_path): dataset_path = tmp_path / "test_dataset" result = runner.invoke(app, ["init", "--dataset", str(dataset_path)]) assert result.exit_code == 0 - result = runner.invoke(app, ["list", "--dataset", str(dataset_path), "ensembles"]) + result = runner.invoke(app, ["lister", "--dataset", str(dataset_path), "ensembles"]) assert result.exit_code == 0 - result = runner.invoke(app, ["list", "--dataset", str(dataset_path), "projects"]) + result = runner.invoke(app, ["lister", "--dataset", str(dataset_path), "projects"]) assert result.exit_code == 0