Compare commits
No commits in common. "e7480b5c962b086044cd9f16c1665ec6e29689d4" and "50fb204cb1433ed1df5b16a2042101f3a843d674" have entirely different histories.
e7480b5c96
...
50fb204cb1
2 changed files with 7 additions and 20 deletions
|
|
@ -4,13 +4,15 @@ from corrlib import __app_name__
|
||||||
|
|
||||||
from .initialization import create
|
from .initialization import create
|
||||||
from .toml import import_tomls, update_project, reimport_project
|
from .toml import import_tomls, update_project, reimport_project
|
||||||
from .find import find_record, list_projects, list_ensembles, get_stat
|
from .find import find_record, list_projects, list_ensembles
|
||||||
from .tools import str2list
|
from .tools import str2list
|
||||||
from .main import update_aliases
|
from .main import update_aliases
|
||||||
from .meas_io import drop_cache as mio_drop_cache
|
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
|
from .integrity import full_integrity_check
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from pyerrors import Corr
|
||||||
from importlib.metadata import version
|
from importlib.metadata import version
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
@ -114,11 +116,6 @@ def find(
|
||||||
if arg == 'all':
|
if arg == 'all':
|
||||||
print(results)
|
print(results)
|
||||||
else:
|
else:
|
||||||
if arg == 'stat':
|
|
||||||
for r in results['path'].values:
|
|
||||||
stat = get_stat(path, r)
|
|
||||||
print(stat)
|
|
||||||
return
|
|
||||||
for r in results[arg].values:
|
for r in results[arg].values:
|
||||||
print(r)
|
print(r)
|
||||||
|
|
||||||
|
|
@ -135,7 +132,10 @@ def stat(
|
||||||
"""
|
"""
|
||||||
Show the statistics of a given record.
|
Show the statistics of a given record.
|
||||||
"""
|
"""
|
||||||
statistics = get_stat(path, record_id)
|
record = mio_load_record(path, record_id)
|
||||||
|
if isinstance(record, (list, Corr)):
|
||||||
|
record = record[0]
|
||||||
|
statistics = record.idl
|
||||||
print(statistics)
|
print(statistics)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
@ -173,7 +173,6 @@ def importer(
|
||||||
"""
|
"""
|
||||||
file_list = files.split(",")
|
file_list = files.split(",")
|
||||||
import_tomls(path, file_list, copy_file)
|
import_tomls(path, file_list, copy_file)
|
||||||
mio_drop_cache(path)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -198,7 +197,6 @@ def reimporter(
|
||||||
raise Exception("This file is not known for this project.")
|
raise Exception("This file is not known for this project.")
|
||||||
else:
|
else:
|
||||||
reimport_project(path, uuid)
|
reimport_project(path, uuid)
|
||||||
mio_drop_cache(path)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,6 @@ from pathlib import Path
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
import warnings
|
import warnings
|
||||||
from .meas_io import load_record
|
|
||||||
from pyerrors import Corr, Obs
|
|
||||||
|
|
||||||
|
|
||||||
def _project_lookup_by_alias(path: Path, alias: str) -> str:
|
def _project_lookup_by_alias(path: Path, alias: str) -> str:
|
||||||
|
|
@ -391,12 +389,3 @@ def list_ensembles(path: Path) -> list[str]:
|
||||||
if os.path.isdir(path / "archive" / item):
|
if os.path.isdir(path / "archive" / item):
|
||||||
res.append(item)
|
res.append(item)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
def get_stat(path: Path, record_id: str) -> Any:
|
|
||||||
loaded_record: Obs = load_record(path, record_id)
|
|
||||||
if isinstance(loaded_record, (list, Corr)):
|
|
||||||
record: Obs = loaded_record[0]
|
|
||||||
else:
|
|
||||||
record = loaded_record
|
|
||||||
return record.idl
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue