add thin wrapper for getting files
This commit is contained in:
parent
d8ec6ef40e
commit
0f499f080a
4 changed files with 27 additions and 20 deletions
|
|
@ -5,7 +5,7 @@ import json
|
|||
import pandas as pd
|
||||
import numpy as np
|
||||
from .input.implementations import codes
|
||||
from .tools import k2m
|
||||
from .tools import k2m, get_file
|
||||
# this will implement the search functionality
|
||||
|
||||
|
||||
|
|
@ -143,7 +143,7 @@ def find_record(path, ensemble, correlator_name, code, project=None, parameters=
|
|||
db = path + '/backlogger.db'
|
||||
if code not in codes:
|
||||
raise ValueError("Code " + code + "unknown, take one of the following:" + ", ".join(codes))
|
||||
dl.get(db, dataset=path)
|
||||
get_file(path, "backlogger.db")
|
||||
results = _db_lookup(db, ensemble, correlator_name,code, project, parameters=parameters, created_before=created_before, created_after=created_after, updated_before=updated_before, updated_after=updated_after, revision=revision)
|
||||
if code == "sfcf":
|
||||
results = sfcf_filter(results, **kwargs)
|
||||
|
|
@ -151,14 +151,14 @@ def find_record(path, ensemble, correlator_name, code, project=None, parameters=
|
|||
return results.reset_index()
|
||||
|
||||
|
||||
def find_project(path, db, name):
|
||||
dl.get(db, dataset=path)
|
||||
return _project_lookup_by_alias(db, name)
|
||||
def find_project(path, name):
|
||||
get_file(path, "backlogger.db")
|
||||
return _project_lookup_by_alias(os.path.join(path, "backlogger.db"), name)
|
||||
|
||||
|
||||
def list_projects(path):
|
||||
db = path + '/backlogger.db'
|
||||
dl.get(db, dataset=path)
|
||||
get_file(path, "backlogger.db")
|
||||
conn = sqlite3.connect(db)
|
||||
c = conn.cursor()
|
||||
c.execute("SELECT id,aliases FROM projects")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue