Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: rename hm / ts #11

Merged
merged 1 commit into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/aerovaldb/aerovaldb.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def put_contour(
raise NotImplementedError

@get_method("/v0/ts/{project}/{experiment}/{region}/{network}/{obsvar}/{layer}")
async def get_ts(
async def get_timeseries(
self,
project: str,
experiment: str,
Expand Down Expand Up @@ -199,7 +199,7 @@ async def get_ts(
raise NotImplementedError

@put_method("/v0/ts/{project}/{experiment}/{region}/{network}/{obsvar}/{layer}")
def put_ts(
def put_timeseries(
self,
obj,
project: str,
Expand Down Expand Up @@ -231,7 +231,7 @@ def put_ts(
@get_method(
"/v0/ts_weekly/{project}/{experiment}/{station}_{network}-{obsvar}_{layer}"
)
async def get_ts_weekly(
async def get_timeseries_weekly(
self,
project: str,
experiment: str,
Expand All @@ -257,7 +257,7 @@ async def get_ts_weekly(
@put_method(
"/v0/ts_weekly/{project}/{experiment}/{station}_{network}-{obsvar}_{layer}"
)
def put_ts_weekly(
def put_timeseries_weekly(
self,
obj,
project: str,
Expand Down Expand Up @@ -477,7 +477,7 @@ def put_map(
@get_method(
"/v0/scat/{project}/{experiment}/{network}-{obsvar}_{layer}_{model}-{modvar}"
)
async def get_scat(
async def get_scatter(
self,
project: str,
experiment: str,
Expand Down Expand Up @@ -506,7 +506,7 @@ async def get_scat(
@put_method(
"/v0/scat/{project}/{experiment}/{network}-{obsvar}_{layer}_{model}-{modvar}"
)
def put_scat(
def put_scatter(
self,
obj,
project: str,
Expand Down Expand Up @@ -579,7 +579,7 @@ def put_profiles(
raise NotImplementedError

@get_method("/v0/hm_ts/{project}/{experiment}")
async def get_hm_ts(
async def get_heatmap_timeseries(
self,
project: str,
experiment: str,
Expand All @@ -599,7 +599,7 @@ async def get_hm_ts(
raise NotImplementedError

@put_method("/v0/hm_ts/{project}/{experiment}")
def put_hm_ts(
def put_heatmap_timeseries(
self,
obj,
project: str,
Expand Down
22 changes: 11 additions & 11 deletions tests/test_jsonfiledb.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
"./project/experiment/contour/",
),
(
"get_ts",
"get_timeseries",
["project", "experiment", "region", "network", "obsvar", "layer"],
None,
"./project/experiment/ts/",
),
(
"get_ts_weekly",
"get_timeseries_weekly",
["project", "experiment", "region", "network", "obsvar", "layer"],
None,
"./project/experiment/ts/dirunal/",
Expand Down Expand Up @@ -60,19 +60,19 @@
"./project/experiment/map/with_time",
),
(
"get_ts_weekly",
"get_timeseries_weekly",
["project", "experiment", "region", "network", "obsvar", "layer"],
None,
"./project/experiment/ts/dirunal/",
),
(
"get_scat",
"get_scatter",
["project", "experiment", "network", "obsvar", "layer", "model", "modvar"],
None,
"./project/experiment/scat/",
),
(
"get_scat",
"get_scatter",
["project", "experiment", "network", "obsvar", "layer", "model", "modvar"],
{"time": "time"},
"./project/experiment/scat/time",
Expand All @@ -84,13 +84,13 @@
"./project/experiment/profiles/",
),
(
"get_hm_ts",
"get_heatmap_timeseries",
["project", "experiment"],
None,
"project/experiment/hm/ts/stats_ts.json",
),
(
"get_hm_ts",
"get_heatmap_timeseries",
["project", "experiment"],
{
"network": "network",
Expand All @@ -100,7 +100,7 @@
"./project/experiment/hm/ts/network-obsvar-layer",
),
(
"get_hm_ts",
"get_heatmap_timeseries",
["project", "experiment"],
{
"network": "network",
Expand Down Expand Up @@ -165,12 +165,12 @@ async def test_put_contour():


@pytest.mark.asyncio
async def test_put_ts():
async def test_put_timeseries():
with aerovaldb.open("json_files:./tests/test-db/tmp") as db:
obj = {"data": "gibberish"}
db.put_ts(obj, "test1", "test2", "test3", "test4", "test5", "test6")
db.put_timeseries(obj, "test1", "test2", "test3", "test4", "test5", "test6")

read_data = await db.get_ts(
read_data = await db.get_timeseries(
"test1", "test2", "test3", "test4", "test5", "test6"
)

Expand Down