diff --git a/corrlib/cli.py b/corrlib/cli.py index d24d8ef..6c1c3c5 100644 --- a/corrlib/cli.py +++ b/corrlib/cli.py @@ -1,7 +1,6 @@ from typing import Optional import typer from corrlib import __app_name__ - from .initialization import create from .toml import import_tomls, update_project, reimport_project from .find import find_record, list_projects @@ -9,8 +8,6 @@ from .tools import str2list 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 -from .integrity import full_integrity_check - import os from pyerrors import Corr from importlib.metadata import version @@ -140,16 +137,6 @@ def stat( return -@app.command() -def check(path: Path = typer.Option( - Path('./corrlib'), - "--dataset", - "-d", - ), - ) -> None: - full_integrity_check(path) - - @app.command() def importer( path: Path = typer.Option( diff --git a/corrlib/integrity.py b/corrlib/integrity.py index dc1216c..d865944 100644 --- a/corrlib/integrity.py +++ b/corrlib/integrity.py @@ -27,21 +27,19 @@ def are_keys_unique(db: Path, table: str, col: str) -> bool: def check_db_integrity(path: Path) -> None: db = get_db_file(path) - if not are_keys_unique(path / db, 'backlogs', 'path'): + if not are_keys_unique(db, 'backlogs', 'path'): raise Exception("The paths the backlog table of the database links are not unique.") search_expr = "SELECT * FROM 'backlogs'" - conn = sqlite3.connect(path / db) + conn = sqlite3.connect(db) results = pd.read_sql(search_expr, conn) for _, result in results.iterrows(): if not has_valid_times(result): raise ValueError(f"Result with id {result[id]} has wrong time signatures.") - print("DB:\t✅") + def full_integrity_check(path: Path) -> None: check_db_integrity(path) - print("Full:\t✅") -