Commit f6cabb71 authored by Drew Leonard's avatar Drew Leonard
Browse files

Add basic outline of a Fido client

Doesn't do anything yet until I know how to query SDC's database.
parent 490c6500
Pipeline #2296 failed with stage
in 26 seconds
import as a
from import AttrAnd, AttrOr, AttrWalker, DataAttr
from import BaseClient, QueryResponseTable
walker = AttrWalker()
def create_or(wlk, tree):
results = []
for sub in tree.attrs:
return results
@walker.add_creator(AttrAnd, DataAttr)
def create_and(wlk, tree):
result = dict()
wlk.apply(tree, result)
return [result]
def _(wlk, attr, params):
return params.update({"startTime": attr.start.isot, "endTime": attr.end.isot})
def _(wlk, attr, params):
return params.update({"level": attr.value})
class KISClient(BaseClient):
def __init__(self):
def _query_api(self, query_params):
"""API query process TBD."""
def search(self, query):
queries = walker.create(query)
results = []
for query_params in queries:
return QueryResponseTable(results, client=self)
def fetch(self):
def _can_handle_query(cls, *query):
query_attrs = set(type(x) for x in query)
supported_attrs = {a.Time, a.Level}
return supported_attrs.issuperset(query_attrs)
def register_values(cls):
adict = {
a.Provider: [
"Science Data Centre at the Leibniz-Institut für Sonnenphysik",
return adict
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment