diff --git a/OceanDataStore/catalog/oceandatacatalog.py b/OceanDataStore/catalog/oceandatacatalog.py
index 1203d24c..75e487c3 100644
--- a/OceanDataStore/catalog/oceandatacatalog.py
+++ b/OceanDataStore/catalog/oceandatacatalog.py
@@ -9,7 +9,6 @@
Authors:
- Ollie Tooth
"""
-import os
from typing import Optional
import icechunk
@@ -395,6 +394,41 @@ def _repr_html_(self) -> str:
if self.Items is not None
else "no search yet"
)
+
+ def _extent_dates(col):
+ try:
+ ext = col.extent.temporal.intervals
+ start = ext[0][0].strftime("%Y-%m-%d") if ext[0][0] else "—"
+ end = ext[0][1].strftime("%Y-%m-%d") if ext[0][1] else "present"
+ except Exception:
+ start, end = "—", "—"
+ return start, end
+
+ rows_html = ""
+ for col in list(self.Catalog.get_all_collections()):
+ start, end = _extent_dates(col)
+ desc = col.description or ""
+ desc_cell = (
+ f""
+ f"Summary
"
+ f"{desc.replace('**', '')}
"
+ f" "
+ if desc else "—"
+ )
+ active = " active" if (
+ self.Collection and col.id == self.Collection.id
+ ) else ""
+ col_title_cell = col.title if col.title else "—"
+ rows_html += (
+ f"
"
f"
"
+ f"
Version {self.Catalog.extra_fields.get('catalog_version', 'None')}
"
f"
Collections {n_collections}
"
f"
Active collection {col_name}
"
f"
Last search {n_items}
"
f"
"
- f"
"
+ f"
"
+ f" "
+ f" | Collection ID | Title | Description | "
+ f" From | To | "
+ f"
"
+ f" {rows_html}"
+ f"
"
+ f"
Source URL
"
+ f"
"
f"
"
f""
)
@@ -431,9 +474,9 @@ def available_items(self) -> list[str]:
# Return all Item IDs from the most recent search:
return [item.id for item in self.Items]
else:
- # Return first 25 Item IDs from the current Collection or root Catalog:
+ # Return all Item IDs from the current Collection or root Catalog:
scope = self.Collection if self.Collection else self.Catalog
- return [next(scope.get_items(recursive=True), None).id for _ in range(25)]
+ return list(item.id for item in scope.get_items(recursive=True))
def summary(self) -> CatalogSummary:
@@ -527,94 +570,9 @@ def summary(self) -> CatalogSummary:
return CatalogSummary(display_text=text, display_html=html)
- def collection_summary(self) -> CatalogSummary:
- """
- Display a summary table of all Collections in the OceanDataCatalog:
-
- * In Jupyter / Marimo environments a styled HTML table is displayed.
- * In plain Python / CLI environments a formatted text table is printed instead.
- """
- collections = list(self.Catalog.get_all_collections())
- n = len(collections)
-
- def _extent_dates(col):
- try:
- ext = col.extent.temporal.intervals
- start = ext[0][0].strftime("%Y-%m-%d") if ext[0][0] else "—"
- end = ext[0][1].strftime("%Y-%m-%d") if ext[0][1] else "present"
- except Exception:
- start, end = "—", "—"
- return start, end
-
- # ----- HTML Output ----- #
- rows_html = ""
- for col in collections:
- start, end = _extent_dates(col)
- desc = col.description or ""
- desc_cell = (
- f"