eodash_catalog 0.0.29__tar.gz → 0.0.30__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of eodash_catalog might be problematic. Click here for more details.

Files changed (33) hide show
  1. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/.bumpversion.cfg +1 -1
  2. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/PKG-INFO +1 -1
  3. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/src/eodash_catalog/__about__.py +1 -1
  4. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/src/eodash_catalog/endpoints.py +39 -9
  5. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/src/eodash_catalog/stac_handling.py +2 -2
  6. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/.github/workflows/ci.yml +0 -0
  7. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/.github/workflows/python-publish.yml +0 -0
  8. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/.gitignore +0 -0
  9. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/.vscode/extensions.json +0 -0
  10. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/.vscode/settings.json +0 -0
  11. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/LICENSE.txt +0 -0
  12. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/README.md +0 -0
  13. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/pyproject.toml +0 -0
  14. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/requirements.txt +0 -0
  15. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/ruff.toml +0 -0
  16. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/src/eodash_catalog/__init__.py +0 -0
  17. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/src/eodash_catalog/duration.py +0 -0
  18. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/src/eodash_catalog/generate_indicators.py +0 -0
  19. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/src/eodash_catalog/sh_endpoint.py +0 -0
  20. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/src/eodash_catalog/thumbnails.py +0 -0
  21. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/src/eodash_catalog/utils.py +0 -0
  22. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/tests/__init__.py +0 -0
  23. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/tests/test-data/regional_forecast.json +0 -0
  24. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/tests/test_generate.py +0 -0
  25. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/tests/testing-catalogs/testing.yaml +0 -0
  26. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/tests/testing-collections/test_CROPOMAT1.yaml +0 -0
  27. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/tests/testing-collections/test_see_solar_energy.yaml +0 -0
  28. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/tests/testing-collections/test_tif_demo_1.yaml +0 -0
  29. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/tests/testing-collections/test_tif_demo_2.yaml +0 -0
  30. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/tests/testing-collections/test_wms_no_time.yaml +0 -0
  31. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/tests/testing-indicators/test_indicator.yaml +0 -0
  32. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/tests/testing-layers/baselayers.yaml +0 -0
  33. {eodash_catalog-0.0.29 → eodash_catalog-0.0.30}/tests/testing-layers/overlays.yaml +0 -0
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 0.0.29
2
+ current_version = 0.0.30
3
3
  commit = True
4
4
  tag = True
5
5
  parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)\.(?P<build>\d+))?
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: eodash_catalog
3
- Version: 0.0.29
3
+ Version: 0.0.30
4
4
  Summary: This package is intended to help create a compatible STAC catalog for the eodash dashboard client. It supports configuration of multiple endpoint types for information extraction.
5
5
  Project-URL: Documentation, https://github.com/eodash/eodash_catalog#readme
6
6
  Project-URL: Issues, https://github.com/eodash/eodash_catalog/issues
@@ -1,4 +1,4 @@
1
1
  # SPDX-FileCopyrightText: 2024-present Daniel Santillan <daniel.santillan@eox.at>
2
2
  #
3
3
  # SPDX-License-Identifier: MIT
4
- __version__ = "0.0.29"
4
+ __version__ = "0.0.30"
@@ -327,10 +327,10 @@ def handle_SH_WMS_endpoint(
327
327
  catalog_config: dict, endpoint_config: dict, collection_config: dict, catalog: Catalog
328
328
  ) -> Collection:
329
329
  # create collection and subcollections (based on locations)
330
+ root_collection = get_or_create_collection(
331
+ catalog, collection_config["Name"], collection_config, catalog_config, endpoint_config
332
+ )
330
333
  if "Locations" in collection_config:
331
- root_collection = get_or_create_collection(
332
- catalog, collection_config["Name"], collection_config, catalog_config, endpoint_config
333
- )
334
334
  for location in collection_config["Locations"]:
335
335
  # create and populate location collections based on times
336
336
  # TODO: Should we add some new description per location?
@@ -373,6 +373,26 @@ def handle_SH_WMS_endpoint(
373
373
  for c_child in root_collection.get_children():
374
374
  if isinstance(c_child, Collection):
375
375
  root_collection.extent.spatial.bboxes.append(c_child.extent.spatial.bboxes[0])
376
+ else:
377
+ # if locations are not provided, treat the collection as a
378
+ # general proxy to the sentinel hub layer
379
+ times = get_collection_times_from_config(endpoint_config)
380
+ bbox = endpoint_config.get("Bbox", [-180, -85, 180, 85])
381
+ for time in times:
382
+ item = Item(
383
+ id=time,
384
+ bbox=bbox,
385
+ properties={},
386
+ geometry=None,
387
+ datetime=parser.isoparse(time),
388
+ stac_extensions=[
389
+ "https://stac-extensions.github.io/web-map-links/v1.1.0/schema.json",
390
+ ],
391
+ )
392
+ add_projection_info(endpoint_config, item)
393
+ add_visualization_info(item, collection_config, endpoint_config, time=time)
394
+ item_link = root_collection.add_item(item)
395
+ item_link.extra_fields["datetime"] = time
376
396
  # eodash v4 compatibility
377
397
  add_collection_information(catalog_config, root_collection, collection_config)
378
398
  add_visualization_info(root_collection, collection_config, endpoint_config)
@@ -606,16 +626,22 @@ def add_visualization_info(
606
626
  "role": ["data"],
607
627
  }
608
628
  )
629
+ dimensions = {}
630
+ if dimensions_config := endpoint_config.get("Dimensions", {}):
631
+ for key, value in dimensions_config.items():
632
+ dimensions[key] = value
609
633
  if time is not None:
610
634
  if endpoint_config["Name"] == "Sentinel Hub WMS":
611
635
  # SH WMS for public collections needs time interval, we use full day here
612
- datetime_object = datetime.strptime(time, "%Y-%m-%d")
636
+ datetime_object = datetime.fromisoformat(time)
613
637
  start = datetime_object.isoformat()
614
638
  end = (datetime_object + timedelta(days=1) - timedelta(milliseconds=1)).isoformat()
615
639
  time_interval = f"{start}/{end}"
616
- extra_fields["wms:dimensions"] = {"TIME": time_interval}
640
+ dimensions["TIME"] = time_interval
617
641
  if endpoint_config["Name"] == "Sentinel Hub":
618
- extra_fields["wms:dimensions"] = {"TIME": time}
642
+ dimensions["TIME"] = time
643
+ if dimensions != {}:
644
+ extra_fields["wms:dimensions"] = dimensions
619
645
  stac_object.add_link(
620
646
  Link(
621
647
  rel="wms",
@@ -632,10 +658,14 @@ def add_visualization_info(
632
658
  "role": ["data"],
633
659
  }
634
660
  )
661
+ dimensions = {}
662
+ if dimensions_config := endpoint_config.get("Dimensions", {}):
663
+ for key, value in dimensions_config.items():
664
+ dimensions[key] = value
635
665
  if time is not None:
636
- extra_fields["wms:dimensions"] = {
637
- "TIME": time,
638
- }
666
+ dimensions["TIME"] = time
667
+ if dimensions != {}:
668
+ extra_fields["wms:dimensions"] = dimensions
639
669
  if "Styles" in endpoint_config:
640
670
  extra_fields["wms:styles"] = endpoint_config["Styles"]
641
671
  media_type = endpoint_config.get("MediaType", "image/jpeg")
@@ -44,7 +44,7 @@ def get_or_create_collection(
44
44
  )
45
45
  times: list[str] = []
46
46
  temporal_extent = TemporalExtent([[datetime.now(), None]])
47
- if endpoint_config and endpoint_config.get("Type") == "OverwriteTimes":
47
+ if endpoint_config:
48
48
  if endpoint_config.get("Times"):
49
49
  times = list(endpoint_config.get("Times", []))
50
50
  times_datetimes = sorted([parser.isoparse(time) for time in times])
@@ -389,7 +389,7 @@ def add_extra_fields(stac_object: Collection | Link, collection_config: dict) ->
389
389
 
390
390
  def get_collection_times_from_config(endpoint_config: dict) -> list[str]:
391
391
  times: list[str] = []
392
- if endpoint_config and endpoint_config.get("Type") == "OverwriteTimes":
392
+ if endpoint_config:
393
393
  if endpoint_config.get("Times"):
394
394
  times = list(endpoint_config.get("Times", []))
395
395
  elif endpoint_config.get("DateTimeInterval"):