eodash_catalog 0.3.6__tar.gz → 0.3.7__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.
Files changed (50) hide show
  1. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/.bumpversion.cfg +1 -1
  2. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/Dockerfile +1 -1
  3. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/PKG-INFO +1 -1
  4. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/src/eodash_catalog/__about__.py +1 -1
  5. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/src/eodash_catalog/endpoints.py +36 -12
  6. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/.dockerignore +0 -0
  7. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/.github/workflows/ci.yml +0 -0
  8. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/.github/workflows/python-publish.yml +0 -0
  9. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/.gitignore +0 -0
  10. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/.vscode/extensions.json +0 -0
  11. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/.vscode/settings.json +0 -0
  12. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/LICENSE.txt +0 -0
  13. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/README.md +0 -0
  14. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/pyproject.toml +0 -0
  15. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/requirements.txt +0 -0
  16. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/ruff.toml +0 -0
  17. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/src/eodash_catalog/__init__.py +0 -0
  18. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/src/eodash_catalog/duration.py +0 -0
  19. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/src/eodash_catalog/generate_indicators.py +0 -0
  20. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/src/eodash_catalog/sh_endpoint.py +0 -0
  21. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/src/eodash_catalog/stac_handling.py +0 -0
  22. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/src/eodash_catalog/thumbnails.py +0 -0
  23. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/src/eodash_catalog/utils.py +0 -0
  24. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/__init__.py +0 -0
  25. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/test-data/regional_forecast.json +0 -0
  26. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/test_generate.py +0 -0
  27. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/test_geoparquet.py +0 -0
  28. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/testing-catalogs/testing-json.json +0 -0
  29. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/testing-catalogs/testing.yaml +0 -0
  30. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/testing-collections/test_CROPOMAT1.yaml +0 -0
  31. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/testing-collections/test_cmems.json +0 -0
  32. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/testing-collections/test_cog.json +0 -0
  33. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/testing-collections/test_geodb.yaml +0 -0
  34. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/testing-collections/test_geodb_locations.yaml +0 -0
  35. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/testing-collections/test_geojson.yaml +0 -0
  36. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/testing-collections/test_locations_processing.json +0 -0
  37. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/testing-collections/test_process.yaml +0 -0
  38. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/testing-collections/test_projection.json +0 -0
  39. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/testing-collections/test_see_solar_energy.yaml +0 -0
  40. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/testing-collections/test_sh_wms.json +0 -0
  41. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/testing-collections/test_sh_wms_locations.json +0 -0
  42. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/testing-collections/test_tif_demo_1.yaml +0 -0
  43. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/testing-collections/test_tif_demo_1_json.json +0 -0
  44. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/testing-collections/test_tif_demo_2.yaml +0 -0
  45. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/testing-collections/test_veda.json +0 -0
  46. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/testing-collections/test_veda_tiles.json +0 -0
  47. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/testing-collections/test_wms_no_time.yaml +0 -0
  48. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/testing-indicators/test_indicator.yaml +0 -0
  49. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/testing-layers/baselayers.yaml +0 -0
  50. {eodash_catalog-0.3.6 → eodash_catalog-0.3.7}/tests/testing-layers/overlays.yaml +0 -0
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 0.3.6
2
+ current_version = 0.3.7
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+))?
@@ -29,4 +29,4 @@ RUN eodash_catalog --help
29
29
 
30
30
  CMD ["eodash_catalog"]
31
31
 
32
- LABEL version="0.3.6"
32
+ LABEL version="0.3.7"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eodash_catalog
3
- Version: 0.3.6
3
+ Version: 0.3.7
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.3.6"
4
+ __version__ = "0.3.7"
@@ -1,3 +1,4 @@
1
+ import copy
1
2
  import importlib
2
3
  import io
3
4
  import json
@@ -538,6 +539,7 @@ def handle_rasdaman_endpoint(
538
539
  # add_example_info(collection, collection_config, endpoint_config, catalog_config)
539
540
  return collection
540
541
 
542
+
541
543
  def handle_GeoDB_Features_endpoint(
542
544
  catalog_config: dict,
543
545
  endpoint_config: dict,
@@ -546,7 +548,6 @@ def handle_GeoDB_Features_endpoint(
546
548
  catalog: Catalog,
547
549
  options: Options,
548
550
  ) -> Collection:
549
-
550
551
  # ID of collection is data["Name"] instead of CollectionId to be able to
551
552
  # create more STAC collections from one geoDB table
552
553
  collection = get_or_create_collection(
@@ -581,13 +582,9 @@ def handle_GeoDB_Features_endpoint(
581
582
  datetime(time_object.year, time_object.month, time_object.day).date()
582
583
  )
583
584
  case "month":
584
- unique_datetimes.add(
585
- datetime(time_object.year, time_object.month, 1).date()
586
- )
585
+ unique_datetimes.add(datetime(time_object.year, time_object.month, 1).date())
587
586
  case "year":
588
- unique_datetimes.add(
589
- datetime(time_object.year, 1, 1).date()
590
- )
587
+ unique_datetimes.add(datetime(time_object.year, 1, 1).date())
591
588
  case _:
592
589
  # default to day
593
590
  unique_datetimes.add(
@@ -610,10 +607,11 @@ def handle_GeoDB_Features_endpoint(
610
607
  updated_query = endpoint_config["Query"].replace("{{date_time}}", matching_string)
611
608
  assets = {
612
609
  "geodbfeatures": Asset(
613
- href=f"{endpoint_config['EndPoint']}{endpoint_config['Database']}_{endpoint_config['CollectionId']}?{updated_query}",
614
- media_type="application/geodb+json",
615
- roles=["data"],
616
- )}
610
+ href=f"{endpoint_config['EndPoint']}{endpoint_config['Database']}_{endpoint_config['CollectionId']}?{updated_query}",
611
+ media_type="application/geodb+json",
612
+ roles=["data"],
613
+ )
614
+ }
617
615
  item = Item(
618
616
  id=format_datetime_to_isostring_zulu(item_datetime),
619
617
  bbox=endpoint_config.get("OverwriteBBox", [-180, -90, 180, 90]),
@@ -724,7 +722,33 @@ def handle_GeoDB_endpoint(
724
722
  input_data = []
725
723
  if len(input_data) > 0 or endpoint_config.get("FeatureCollection"):
726
724
  items = []
727
- for v in values:
725
+ content_for_individual_datetimes = values
726
+ if endpoint_config.get("MapTimesCollection"):
727
+ # extract datetimes from another table if configured so and match it based on aoi_id
728
+ # special for E13d
729
+ select = f"?select=time&aoi_id=eq.{key}"
730
+ url = (
731
+ endpoint_config["EndPoint"]
732
+ + endpoint_config["Database"]
733
+ + "_{}".format(endpoint_config["MapTimesCollection"])
734
+ + select
735
+ )
736
+ response = json.loads(requests.get(url).text)
737
+ content_for_individual_datetimes = []
738
+ for response_obj in response:
739
+ time_object = datetime.fromisoformat(response_obj["time"])
740
+ for searched_row in values:
741
+ search_datetime = datetime.fromisoformat(searched_row["time"])
742
+ if (
743
+ search_datetime.month == time_object.month
744
+ and search_datetime.year == time_object.year
745
+ ):
746
+ break
747
+ insert_row = copy.deepcopy(searched_row)
748
+ # overwrite time with one from another collection and save
749
+ insert_row["time"] = response_obj["time"]
750
+ content_for_individual_datetimes.append(insert_row)
751
+ for v in content_for_individual_datetimes:
728
752
  # add items based on inputData fields for each time step available in values
729
753
  first_match: dict = next(
730
754
  (item for item in input_data if item.get("Identifier") == v["input_data"]), None
File without changes
File without changes