intake / intake-esm

An intake plugin for parsing an Earth System Model (ESM) catalog and loading assets into xarray datasets.
https://intake-esm.readthedocs.io
Apache License 2.0
134 stars 44 forks source link

Add 'Developers Guide' section of Documentation #101

Closed jukent closed 5 years ago

jukent commented 5 years ago

Related to issue #86 but specific for the contributions section of documentation. We want to make it easy for groups that want to use intake-esm to add their data to the catalogue.

jukent commented 5 years ago

Meeting with @andersy005 scheduled to improve skeleton of this section.

pbranson commented 5 years ago

Following on from this comment https://github.com/NCAR/intake-esm/pull/107#issuecomment-515112910 I thought maybe this issue might be the right place to answer.

It would be great in the developer section to explain how to make a plugin that uses the intake-esm classes but doesn't require modifying the core code base.

I have done that here: https://bitbucket.csiro.au/users/bra467/repos/bluelink_intake_esm/browse

All that seems to be required is:

  1. Add sources to .intake_esm file (I also added collection_types to .intake_esm but I dont think that did anything).
  2. Add collection definitions to .intake_esm
  3. At the bottom of the file with the Collection Classes I added some code to alter the collection_types dictionary i.e. intake_esm.ESMMetadataStoreCatalog.collection_types['wavewatch']=WAVEWATCHCollection

Then I just import the python file with the classes, with the file named according to the intake specification i.e.:

import intake
import intake_bluelink

I think that was it - not sure if this is the best way to go about it, it would be good if collection_types could be specified in the .intake_esm file the same way the sources are.

In the process of doing this I also noticed that the jinja templating that is available in normal intake for the yaml files doesnt work here - see issue #116

jukent commented 5 years ago

Thanks for the idea, we can definitely add a page on that. I might ask you some questions next week about this.