From 1cb3c5f87eb3f10669c558572960592898329f38 Mon Sep 17 00:00:00 2001 From: Jason Boutte Date: Thu, 10 Aug 2023 01:19:31 -0700 Subject: [PATCH] Adds intake_es documentation --- .../intake_es/src/intake_es/catalog.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/dockerfiles/minimal-notebook/intake_es/src/intake_es/catalog.py b/dockerfiles/minimal-notebook/intake_es/src/intake_es/catalog.py index de66e94..2103c4b 100644 --- a/dockerfiles/minimal-notebook/intake_es/src/intake_es/catalog.py +++ b/dockerfiles/minimal-notebook/intake_es/src/intake_es/catalog.py @@ -24,6 +24,16 @@ def __init__( skip_client=False, **kwargs, ): + """Elasticsearch intake catalog. + + Args: + index: String name of the index to search. + host: String url to the Elasticsearch cluster. + es_kwargs: Dictionary of arguments to pass Elasticsearch client. + search_kwargs: Dictionary of initial search arguments. + skip_client: Bool to skip initializing the Elasticsearch client. + kwargs: Extra arguments to pass to `intake.Catalog`. + """ super().__init__(**kwargs) self._index = index @@ -41,6 +51,17 @@ def __init__( self._entries = {} def search(self, **kwargs): + """Search the Elasticsearch index. + + The values of the search arguments can be a string or list. If a list + the each value must be present to match. + + Args: + kwargs: Search arguments. + + Examples: + >>> cat.search(activity_drs='ScenarioMIP', variable_id=['pr', 'tas']) + """ if len(kwargs) == 0: warnings.warn( "No search arguments, this may take awhile",