From 00ec9f7f8a7b19747e4dbdf29cca58200e95319f Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Thu, 4 Dec 2025 15:15:24 +0100 Subject: [PATCH] roll out tracker unlock implementation --- corrlib/meas_io.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/corrlib/meas_io.py b/corrlib/meas_io.py index d17750e..aec7891 100644 --- a/corrlib/meas_io.py +++ b/corrlib/meas_io.py @@ -8,7 +8,7 @@ from typing import Union from pyerrors import Obs, Corr, dump_object, load_object from hashlib import sha256 from .tools import get_db_file, cache_enabled -from .tracker import get, save +from .tracker import get, save, unlock import shutil from typing import Any @@ -32,7 +32,7 @@ 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) get(path, db_file) - dl.unlock(db, dataset=path) + unlock(path, db_file) conn = sqlite3.connect(db) c = conn.cursor() files = [] @@ -45,7 +45,7 @@ def write_measurement(path: str, ensemble: str, measurement: dict[str, dict[str, os.makedirs(os.path.join(path, '.', 'archive', ensemble, corr)) else: if os.path.exists(file): - dl.unlock(file, dataset=path) + unlock(path, file_in_archive) known_meas = pj.load_json_dict(file) if code == "sfcf": parameters = sfcf.read_param(path, uuid, parameter_file) @@ -184,7 +184,7 @@ def drop_record(path: str, meas_path: str) -> None: db = os.path.join(path, db_file) get(path, db_file) sub_key = meas_path.split("::")[1] - dl.unlock(db, dataset=path) + unlock(path, db_file) conn = sqlite3.connect(db) c = conn.cursor() if c.execute("SELECT * FROM backlogs WHERE path = ?", (meas_path, )).fetchone() is not None: @@ -196,7 +196,7 @@ def drop_record(path: str, meas_path: str) -> None: known_meas = pj.load_json_dict(file) if sub_key in known_meas: del known_meas[sub_key] - dl.unlock(file, dataset=path) + unlock(path, file_in_archive) pj.dump_dict_to_json(known_meas, file) save(path, message="Drop measurements to database", files=[db, file]) return