Compare commits

...

28 commits

Author SHA1 Message Date
158fb1d08b Merge pull request 'fix/uv-setup' (#21) from fix/uv-setup into develop
All checks were successful
Mypy / mypy (push) Successful in 1m18s
Pytest / pytest (3.12) (push) Successful in 1m19s
Pytest / pytest (3.13) (push) Successful in 1m17s
Pytest / pytest (3.14) (push) Successful in 1m17s
Ruff / ruff (push) Successful in 1m0s
Reviewed-on: https://www.kuhl-mann.de/git/git/jkuhl/corrlib/pulls/21
2026-03-23 12:40:22 +01:00
b65ee83698 fix list test
All checks were successful
Mypy / mypy (push) Successful in 1m14s
Pytest / pytest (3.12) (push) Successful in 1m16s
Pytest / pytest (3.13) (push) Successful in 1m14s
Pytest / pytest (3.14) (push) Successful in 1m17s
Ruff / ruff (push) Successful in 1m1s
Mypy / mypy (pull_request) Successful in 1m10s
Pytest / pytest (3.12) (pull_request) Successful in 1m17s
Pytest / pytest (3.13) (pull_request) Successful in 1m15s
Pytest / pytest (3.14) (pull_request) Successful in 1m14s
Ruff / ruff (pull_request) Successful in 1m1s
2026-03-20 23:37:40 +01:00
a5d6b978ea
remove pip cache
Some checks failed
Mypy / mypy (push) Failing after 39s
Pytest / pytest (3.12) (push) Failing after 40s
Pytest / pytest (3.13) (push) Failing after 39s
Pytest / pytest (3.14) (push) Failing after 42s
Ruff / ruff (push) Failing after 39s
Mypy / mypy (pull_request) Failing after 39s
Pytest / pytest (3.13) (pull_request) Failing after 39s
Pytest / pytest (3.14) (pull_request) Failing after 42s
Pytest / pytest (3.12) (pull_request) Failing after 1m14s
Ruff / ruff (pull_request) Failing after 39s
2026-03-20 17:25:44 +01:00
c2296f00ee
remove uv cache
Some checks failed
Pytest / pytest (3.13) (pull_request) Failing after 42s
Pytest / pytest (3.14) (pull_request) Failing after 41s
Ruff / ruff (pull_request) Successful in 1m2s
Mypy / mypy (pull_request) Successful in 1m12s
Mypy / mypy (push) Failing after 39s
Pytest / pytest (3.12) (push) Failing after 39s
Pytest / pytest (3.13) (push) Failing after 39s
Pytest / pytest (3.14) (push) Failing after 43s
Ruff / ruff (push) Failing after 40s
Pytest / pytest (3.12) (pull_request) Failing after 39s
2026-03-20 16:47:36 +01:00
94b677262a
remove cache envs
Some checks failed
Mypy / mypy (push) Failing after 34s
Pytest / pytest (3.13) (push) Failing after 36s
Ruff / ruff (push) Waiting to run
Mypy / mypy (pull_request) Waiting to run
Pytest / pytest (3.12) (pull_request) Waiting to run
Pytest / pytest (3.13) (pull_request) Waiting to run
Pytest / pytest (3.14) (pull_request) Waiting to run
Ruff / ruff (pull_request) Waiting to run
Pytest / pytest (3.12) (push) Failing after 34s
Pytest / pytest (3.14) (push) Has been cancelled
2026-03-20 16:45:01 +01:00
6cfa51f878
setup local cache
Some checks failed
Mypy / mypy (pull_request) Waiting to run
Pytest / pytest (3.12) (pull_request) Waiting to run
Pytest / pytest (3.13) (pull_request) Waiting to run
Pytest / pytest (3.14) (pull_request) Waiting to run
Ruff / ruff (pull_request) Waiting to run
Mypy / mypy (push) Failing after 34s
Pytest / pytest (3.12) (push) Failing after 34s
Pytest / pytest (3.13) (push) Failing after 19s
Pytest / pytest (3.14) (push) Failing after 36s
Ruff / ruff (push) Has been cancelled
2026-03-20 16:42:55 +01:00
c6f3603fbf
Throw errors when parmeter file is not set
Some checks failed
Pytest / pytest (3.14) (push) Failing after 41s
Mypy / mypy (push) Successful in 1m15s
Pytest / pytest (3.13) (push) Failing after 41s
Mypy / mypy (pull_request) Failing after 39s
Pytest / pytest (3.12) (pull_request) Failing after 39s
Pytest / pytest (3.13) (pull_request) Failing after 40s
Pytest / pytest (3.14) (pull_request) Failing after 43s
Ruff / ruff (pull_request) Failing after 39s
Ruff / ruff (push) Successful in 1m3s
Pytest / pytest (3.12) (push) Failing after 1m18s
2026-03-20 16:12:57 +01:00
bd581c6c12
set up git
Some checks failed
Ruff / ruff (push) Waiting to run
Pytest / pytest (3.12) (push) Failing after 1m16s
Pytest / pytest (3.13) (push) Failing after 1m13s
Mypy / mypy (push) Failing after 1m11s
Pytest / pytest (3.14) (push) Has been cancelled
2026-03-20 16:07:57 +01:00
d302ae7e0d
fix typo in type annotations
Some checks failed
Pytest / pytest (3.12) (push) Failing after 1m18s
Ruff / ruff (push) Has been cancelled
Mypy / mypy (push) Failing after 1m12s
Pytest / pytest (3.13) (push) Failing after 1m13s
Pytest / pytest (3.14) (push) Failing after 1m16s
2026-03-20 16:01:59 +01:00
7ce9742ed5
fix invalid escape in docs
Some checks failed
Ruff / ruff (push) Waiting to run
Mypy / mypy (push) Failing after 1m11s
Pytest / pytest (3.12) (push) Has been cancelled
Pytest / pytest (3.14) (push) Has been cancelled
Pytest / pytest (3.13) (push) Has been cancelled
2026-03-20 15:59:45 +01:00
4853c0e414
fix type error for now 2026-03-20 15:58:33 +01:00
0c01d18ecb
use python 3.12 for mypy and ruff 2026-03-20 15:56:31 +01:00
f05caf572d
roll out changes
Some checks failed
Mypy / mypy (push) Failing after 1m9s
Pytest / pytest (3.12) (push) Failing after 1m18s
Pytest / pytest (3.13) (push) Failing after 1m13s
Pytest / pytest (3.14) (push) Failing after 1m17s
Ruff / ruff (push) Failing after 40s
2026-03-20 15:52:57 +01:00
4a821006ed
add setup python
Some checks failed
Ruff / ruff (push) Waiting to run
Mypy / mypy (push) Failing after 16s
Pytest / pytest (3.12) (push) Failing after 1m35s
Pytest / pytest (3.13) (push) Failing after 1m13s
Pytest / pytest (3.14) (push) Has been cancelled
2026-03-20 15:49:35 +01:00
53067f7c47
use v5
Some checks failed
Ruff / ruff (push) Waiting to run
Pytest / pytest (3.12) (push) Failing after 55s
Pytest / pytest (3.14) (push) Has been cancelled
Pytest / pytest (3.13) (push) Failing after 52s
Mypy / mypy (push) Failing after 16s
2026-03-20 15:47:02 +01:00
67a9e4ea4b
use 6.4.0
Some checks failed
Mypy / mypy (push) Failing after 15s
Pytest / pytest (3.13) (push) Failing after 18s
Ruff / ruff (push) Failing after 15s
Pytest / pytest (3.12) (push) Failing after 19s
Pytest / pytest (3.14) (push) Failing after 19s
2026-03-20 15:31:03 +01:00
ca2eb081bb
older version again
Some checks failed
Mypy / mypy (push) Failing after 16s
Pytest / pytest (3.12) (push) Failing after 16s
Pytest / pytest (3.13) (push) Failing after 15s
Pytest / pytest (3.14) (push) Failing after 15s
Ruff / ruff (push) Failing after 14s
2026-03-20 15:29:34 +01:00
0e0153bd1d
update uv setup after runner upate
Some checks failed
Mypy / mypy (push) Failing after 19s
Pytest / pytest (3.12) (push) Failing after 15s
Pytest / pytest (3.13) (push) Failing after 16s
Pytest / pytest (3.14) (push) Failing after 14s
Ruff / ruff (push) Failing after 15s
2026-03-20 15:23:49 +01:00
54b42040a9
use v6 of astral action
Some checks failed
Mypy / mypy (push) Failing after 16s
Ruff / ruff (push) Failing after 2s
Pytest / pytest (3.12) (push) Failing after 18s
Pytest / pytest (3.13) (push) Failing after 14s
Pytest / pytest (3.14) (push) Failing after 15s
2026-03-20 15:07:54 +01:00
52f6b0f53c
silence readers
Some checks failed
Pytest / pytest (3.13) (push) Failing after 2s
Ruff / ruff (push) Failing after 2s
Mypy / mypy (push) Failing after 17s
Pytest / pytest (3.12) (push) Failing after 2s
Pytest / pytest (3.14) (push) Failing after 2s
2026-03-20 13:00:30 +01:00
96731baeb9
fix when files are unlocked or saved 2026-03-20 12:59:04 +01:00
a9cc2b3f48
fix write measurement call and reporting to user 2026-03-20 12:57:48 +01:00
6b2db911bf
add list for stat types
Some checks failed
Mypy / mypy (push) Failing after 19s
Pytest / pytest (3.12) (push) Failing after 5s
Pytest / pytest (3.13) (push) Failing after 2s
Pytest / pytest (3.14) (push) Failing after 3s
Ruff / ruff (push) Failing after 2s
2026-03-20 12:56:27 +01:00
b51a69bc69
fix file unlock
Some checks failed
Mypy / mypy (push) Failing after 45s
Pytest / pytest (3.12) (push) Failing after 2s
Pytest / pytest (3.13) (push) Failing after 2s
Pytest / pytest (3.14) (push) Failing after 2s
Ruff / ruff (push) Failing after 2s
2026-03-06 15:35:49 +01:00
b2ac8939a3
fix: cli show stat failed for single values 2026-02-27 11:20:28 +01:00
373f3476c0
explicit install-uv version
Some checks failed
Mypy / mypy (push) Failing after 28s
Pytest / pytest (3.12) (push) Failing after 20s
Pytest / pytest (3.13) (push) Failing after 2s
Pytest / pytest (3.14) (push) Failing after 1s
Ruff / ruff (push) Failing after 1s
2026-02-24 09:18:51 +01:00
540160c51f
use older setup-uv action
Some checks failed
Pytest / pytest (3.12) (push) Failing after 21s
Mypy / mypy (push) Failing after 43s
Pytest / pytest (3.14) (push) Failing after 2s
Ruff / ruff (push) Failing after 2s
Pytest / pytest (3.13) (push) Failing after 19s
2026-02-24 09:14:12 +01:00
875d7b9461
write explicit setup-uv link
Some checks failed
Pytest / pytest (3.12) (push) Failing after 2s
Pytest / pytest (3.13) (push) Failing after 2s
Pytest / pytest (3.14) (push) Failing after 2s
Ruff / ruff (push) Failing after 2s
Mypy / mypy (push) Failing after 3s
2026-02-23 09:45:00 +01:00
10 changed files with 55 additions and 40 deletions

View file

@ -8,8 +8,6 @@ on:
jobs:
mypy:
runs-on: ubuntu-latest
env:
UV_CACHE_DIR: /tmp/.uv-cache
steps:
- name: Install git-annex
run: |
@ -19,11 +17,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:
python-version: ${{ matrix.python-version }}
enable-cache: true
python-version: "3.12"
- 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

View file

@ -17,9 +17,11 @@ jobs:
- "3.14"
runs-on: ubuntu-latest
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
@ -28,11 +30,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:
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 ${{ matrix.python-version }}
- name: Run tests

View file

@ -9,8 +9,6 @@ jobs:
ruff:
runs-on: ubuntu-latest
env:
UV_CACHE_DIR: /tmp/.uv-cache
steps:
- name: Install git-annex
run: |
@ -20,10 +18,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: "3.12"
- 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

View file

@ -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
@ -38,7 +39,7 @@ def update(
@app.command()
def list(
def lister(
path: str = typer.Option(
str('./corrlib'),
"--dataset",
@ -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, (list, Corr)):
record = record[0]
statistics = record.idl
print(statistics)
return

View file

@ -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

View file

@ -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]

View file

@ -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[str, None]) -> None:
"""
Write a measurement to the backlog.
If the file for the measurement already exists, update the measurement.
@ -34,24 +34,33 @@ 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):
if file not in files_to_save:
unlock(path, file_in_archive)
known_meas = pj.load_json_dict(file)
files_to_save.append(file_in_archive)
known_meas = pj.load_json_dict(file, verbose=False)
if code == "sfcf":
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:
@ -60,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':
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"])):
@ -98,9 +110,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

View file

@ -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))

View file

@ -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

View file

@ -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