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

WIP: Experimenting with coverageJSON #11

Merged
merged 7 commits into from
Sep 18, 2020

Conversation

benbovy
Copy link
Member

@benbovy benbovy commented Sep 15, 2020

Closes #8.

I plan to add here a few API endpoints that return model data formatted as coverageJSON.

@benbovy
Copy link
Member Author

benbovy commented Sep 16, 2020

I've just added some demo API endpoints to:

  • get gridded data
  • extract model time-series at a given lat/lon location
  • extract model data along given, time-dependent ship trajectories .

@willirath, @alirezamdv You'll be able to try it using the interactive /docs and copy/paste the results in https://covjson.org/playground/ to quickly visualize the extracted data.

I ended up implementing the coverageJSON specs as pydantic models. It's still not complete but ~ 80% of the specs are already implemented. I followed the specs quite strictly. This results in a lot of small pydantic models and right now looks a bit verbose compared to using plain Python dictionaries. However, we really benefit from pydantic's automated validation and I'm sure that a few helper functions for converting xarray Datasets from/to pydantic model instances will allow us to write new API endpoints super efficiently.

We could still further polish things like endpoint path names and input parameters, but this can be done later as this is still experimental. To me it's ready to merge, so that @alirezamdv can give it a try.

Unfortunately this domain is not implemented in leaflet-coverage.
@benbovy benbovy merged commit 0b3745f into ESM-VFC:master Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use CoverageJSON for serializing model (and observational) data?
1 participant