ESM-VFC / esm-vfc-api-demo

MIT License
3 stars 2 forks source link

Simple flask app follow-up #4

Closed benbovy closed 4 years ago

benbovy commented 4 years ago

Follow-up from #2.

Extract tracks query:

benbovy commented 4 years ago

This is ready ;-)

willirath commented 4 years ago

This is ready ;-)

Looks good.

One thing: With

requests.get(server_url + '/api/v1.0/datasets/demo/fieldnames').json()

lists all keys (including coords) as fieldnames, because https://github.com/ESM-VFC/esm-vfc-api-demo/blob/1355452d3f60fd5427349b9dbc786282cec7baac/app/app.py#L35 uses the Zarr keys for variable name lookup. I'd change to

fieldnames = list(xr.open_zarr(demo_dataset_http_map, consolidated=True).data_vars.keys())
benbovy commented 4 years ago

Agreed, it's better to return data variables only.

I made the change but I think it will be better to fix this upstream, as xr.open_zarr() is pretty heavy (i.e., all metadata is passed) just for getting the names of the data variables.

I'll open a couple of issues in the xpublish repo.

willirath commented 4 years ago

I'll open a couple of issues in the xpublish repo.

👍