Compare commits
4 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 314234fed8 | |||
|
60b56dfb25 |
|||
| 06b07bc590 | |||
|
0d6ad8f552 |
2 changed files with 35 additions and 4 deletions
|
|
@ -7,6 +7,7 @@ from .find import find_record, list_projects
|
||||||
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
|
||||||
import os
|
import os
|
||||||
from importlib.metadata import version
|
from importlib.metadata import version
|
||||||
|
|
||||||
|
|
@ -35,6 +36,7 @@ def update(
|
||||||
update_project(path, uuid)
|
update_project(path, uuid)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
@app.command()
|
@app.command()
|
||||||
def list(
|
def list(
|
||||||
path: str = typer.Option(
|
path: str = typer.Option(
|
||||||
|
|
@ -94,12 +96,39 @@ def find(
|
||||||
ensemble: str = typer.Argument(),
|
ensemble: str = typer.Argument(),
|
||||||
corr: str = typer.Argument(),
|
corr: str = typer.Argument(),
|
||||||
code: str = typer.Argument(),
|
code: str = typer.Argument(),
|
||||||
|
arg: str = typer.Option(
|
||||||
|
str('all'),
|
||||||
|
"--argument",
|
||||||
|
"-a",
|
||||||
|
),
|
||||||
) -> None:
|
) -> None:
|
||||||
"""
|
"""
|
||||||
Find a record in the backlog at hand. Through specifying it's ensemble and the measured correlator.
|
Find a record in the backlog at hand. Through specifying it's ensemble and the measured correlator.
|
||||||
"""
|
"""
|
||||||
results = find_record(path, ensemble, corr, code)
|
results = find_record(path, ensemble, corr, code)
|
||||||
print(results)
|
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()
|
@app.command()
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import datalad.api as dl
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
from fnmatch import fnmatch
|
||||||
|
|
||||||
|
|
||||||
bi_corrs: list[str] = ["f_P", "fP", "f_p",
|
bi_corrs: list[str] = ["f_P", "fP", "f_p",
|
||||||
|
|
@ -298,9 +299,10 @@ def read_data(path: str, project: str, dir_in_project: str, prefix: str, param:
|
||||||
if not appended:
|
if not appended:
|
||||||
compact = (version[-1] == "c")
|
compact = (version[-1] == "c")
|
||||||
for i, item in enumerate(ls):
|
for i, item in enumerate(ls):
|
||||||
rep_path = directory + '/' + item
|
if fnmatch(item, prefix + "*"):
|
||||||
sub_ls = pe.input.sfcf._find_files(rep_path, prefix, compact, [])
|
rep_path = directory + '/' + item
|
||||||
files_to_get.extend([rep_path + "/" + filename for filename in sub_ls])
|
sub_ls = pe.input.sfcf._find_files(rep_path, prefix, compact, [])
|
||||||
|
files_to_get.extend([rep_path + "/" + filename for filename in sub_ls])
|
||||||
|
|
||||||
|
|
||||||
print("Getting data, this might take a while...")
|
print("Getting data, this might take a while...")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue