Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/eodash_catalog/generate_indicators.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ def process_indicator_file(
parent_indicator,
options,
"Disable" in indicator_config and collection in indicator_config["Disable"],
"Hidden" in indicator_config and collection in indicator_config["Hidden"],
coll_path_rel_to_root_catalog,
)
else:
Expand All @@ -205,6 +206,7 @@ def process_collection_file(
catalog: Catalog | Collection,
options: Options,
disable=False,
hidden=False,
coll_path_rel_to_root_catalog: str = "",
):
LOGGER.info(f"Processing collection: {file_path}")
Expand Down Expand Up @@ -333,7 +335,9 @@ def process_collection_file(
if not options.gp:
add_single_item_if_collection_empty(endpoint_config, collection)
add_projection_info(endpoint_config, collection)
add_to_catalog(collection, catalog, endpoint_config, collection_config, disable)
add_to_catalog(
collection, catalog, endpoint_config, collection_config, disable, hidden
)
else:
raise Exception(f"No collection was generated for resource {endpoint_config}")
except Exception as e:
Expand Down Expand Up @@ -370,6 +374,7 @@ def process_collection_file(
parent_collection,
options,
False,
False,
coll_path_rel_to_root_catalog,
)
# find link in parent collection to update metadata
Expand Down Expand Up @@ -434,7 +439,8 @@ def process_collection_file(


def add_to_catalog(
collection: Collection, catalog: Catalog, endpoint: dict, collection_config: dict, disable=False
collection: Collection, catalog: Catalog, endpoint: dict,
collection_config: dict, disable=False, hidden=False
):
# check if already in catalog, if it is do not re-add it
# TODO: probably we should add to the catalog only when creating
Expand Down Expand Up @@ -475,6 +481,8 @@ def add_to_catalog(
# Check for summaries and bubble up info
if disable:
link.extra_fields["roles"] = ["disable"]
if hidden:
link.extra_fields["roles"] = ["hidden"]
if collection.summaries.lists:
for summary in collection.summaries.lists:
link.extra_fields[summary] = collection.summaries.lists[summary]
Expand Down