Merge pull request 'add a simple method to show the statistics of a record' (#18) from feat/cli_stat into develop
Reviewed-on: https://www.kuhl-mann.de/git/git/jkuhl/corrlib/pulls/18
This commit is contained in:
commit
06b07bc590
1 changed files with 30 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ from .find import find_record, list_projects
|
|||
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
|
||||
import os
|
||||
from importlib.metadata import version
|
||||
|
||||
|
|
@ -35,6 +36,7 @@ def update(
|
|||
update_project(path, uuid)
|
||||
return
|
||||
|
||||
|
||||
@app.command()
|
||||
def list(
|
||||
path: str = typer.Option(
|
||||
|
|
@ -94,12 +96,39 @@ def find(
|
|||
ensemble: str = typer.Argument(),
|
||||
corr: str = typer.Argument(),
|
||||
code: str = typer.Argument(),
|
||||
arg: str = typer.Option(
|
||||
str('all'),
|
||||
"--argument",
|
||||
"-a",
|
||||
),
|
||||
) -> None:
|
||||
"""
|
||||
Find a record in the backlog at hand. Through specifying it's ensemble and the measured correlator.
|
||||
"""
|
||||
results = find_record(path, ensemble, corr, code)
|
||||
if arg == 'all':
|
||||
print(results)
|
||||
else:
|
||||
for r in results[arg].values:
|
||||
print(r)
|
||||
|
||||
|
||||
@app.command()
|
||||
def stat(
|
||||
path: str = typer.Option(
|
||||
str('./corrlib'),
|
||||
"--dataset",
|
||||
"-d",
|
||||
),
|
||||
record: str = typer.Argument(),
|
||||
) -> None:
|
||||
"""
|
||||
Show the statistics of a given record.
|
||||
"""
|
||||
record = mio_load_record(path, record)[0]
|
||||
statistics = record.idl
|
||||
print(statistics)
|
||||
return
|
||||
|
||||
|
||||
@app.command()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue