From be257337518233b1ba7c816c8b625bcef5052cc5 Mon Sep 17 00:00:00 2001 From: rhysrevans3 Date: Thu, 4 Apr 2024 16:20:00 +0100 Subject: [PATCH] Moving instake kwarg unpacking. --- stac_generator/plugins/inputs/intake_esm.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/stac_generator/plugins/inputs/intake_esm.py b/stac_generator/plugins/inputs/intake_esm.py index 38f8448..da01cec 100644 --- a/stac_generator/plugins/inputs/intake_esm.py +++ b/stac_generator/plugins/inputs/intake_esm.py @@ -32,6 +32,9 @@ - Optional kwargs to pass to `esm_datastore.search `_ + * - ``skip`` + - ``int`` + - Optional value to skip the first n rows Example Configuration: @@ -81,13 +84,11 @@ def __init__(self, **kwargs): def open_catalog(self, uri, intake_kwargs): """Open the ESM catalog.""" LOGGER.info(f"Opening catalog {uri}") - catalog = intake.open_esm_datastore(uri, **intake_kwargs) - - return catalog + return intake.open_esm_datastore(uri, **intake_kwargs) def search_catalog(self, catalog, search_kwargs): """Perform a search ESM catalog.""" - LOGGER.info(f"Searching catalog") + LOGGER.info("Searching catalog") if self.search_kwargs: catalog = catalog.search(**search_kwargs) @@ -99,10 +100,10 @@ def run(self, generator: BaseGenerator): total_files = 0 start = datetime.now() - catalog = self.open_catalog(self.uri, **self.intake_kwargs) + catalog = self.open_catalog(self.uri, self.intake_kwargs) if self.search_kwargs: - catalog = self.open_catalog(catalog, **self.intake_kwargs) + catalog = self.open_catalog(catalog, self.search_kwargs) count = 0 for _, row in catalog.df.iterrows():