eodash_catalog 0.0.14__tar.gz → 0.0.15__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.14 → eodash_catalog-0.0.15}/.bumpversion.cfg +1 -1
  2. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/PKG-INFO +1 -1
  3. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/src/eodash_catalog/__about__.py +1 -1
  4. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/src/eodash_catalog/endpoints.py +41 -54
  5. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/.github/workflows/ci.yml +0 -0
  6. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/.github/workflows/python-publish.yml +0 -0
  7. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/.gitignore +0 -0
  8. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/.vscode/extensions.json +0 -0
  9. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/.vscode/settings.json +0 -0
  10. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/LICENSE.txt +0 -0
  11. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/README.md +0 -0
  12. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/pyproject.toml +0 -0
  13. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/requirements.txt +0 -0
  14. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/ruff.toml +0 -0
  15. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/src/eodash_catalog/__init__.py +0 -0
  16. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/src/eodash_catalog/duration.py +0 -0
  17. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/src/eodash_catalog/generate_indicators.py +0 -0
  18. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/src/eodash_catalog/sh_endpoint.py +0 -0
  19. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/src/eodash_catalog/stac_handling.py +0 -0
  20. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/src/eodash_catalog/thumbnails.py +0 -0
  21. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/src/eodash_catalog/utils.py +0 -0
  22. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/tests/__init__.py +0 -0
  23. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/tests/test-data/regional_forecast.json +0 -0
  24. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/tests/test_generate.py +0 -0
  25. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/tests/testing-catalogs/testing.yaml +0 -0
  26. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/tests/testing-collections/test_CROPOMAT1.yaml +0 -0
  27. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/tests/testing-collections/test_see_solar_energy.yaml +0 -0
  28. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/tests/testing-collections/test_tif_demo_1.yaml +0 -0
  29. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/tests/testing-collections/test_tif_demo_2.yaml +0 -0
  30. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/tests/testing-collections/test_wms_no_time.yaml +0 -0
  31. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/tests/testing-indicators/test_indicator.yaml +0 -0
  32. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/tests/testing-layers/baselayers.yaml +0 -0
  33. {eodash_catalog-0.0.14 → eodash_catalog-0.0.15}/tests/testing-layers/overlays.yaml +0 -0
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 0.0.14
2
+ current_version = 0.0.15
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.14
3
+ Version: 0.0.15
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.14"
4
+ __version__ = "0.0.15"
@@ -106,29 +106,17 @@ def handle_STAC_based_endpoint(
106
106
  catalog, collection_config["Name"], collection_config, catalog_config, endpoint_config
107
107
  )
108
108
  for location in collection_config["Locations"]:
109
- if "FilterDates" in location:
110
- collection = process_STACAPI_Endpoint(
111
- catalog_config=catalog_config,
112
- endpoint_config=endpoint_config,
113
- collection_config=collection_config,
114
- catalog=catalog,
115
- options=options,
116
- headers=headers,
117
- bbox=",".join(map(str, location["Bbox"])),
118
- filter_dates=location["FilterDates"],
119
- root_collection=root_collection,
120
- )
121
- else:
122
- collection = process_STACAPI_Endpoint(
123
- catalog_config=catalog_config,
124
- endpoint_config=endpoint_config,
125
- collection_config=collection_config,
126
- catalog=catalog,
127
- options=options,
128
- headers=headers,
129
- bbox=",".join(map(str, location["Bbox"])),
130
- root_collection=root_collection,
131
- )
109
+ collection = process_STACAPI_Endpoint(
110
+ catalog_config=catalog_config,
111
+ endpoint_config=endpoint_config,
112
+ collection_config=collection_config,
113
+ catalog=catalog,
114
+ options=options,
115
+ headers=headers,
116
+ filter_dates=location.get("FilterDates"),
117
+ bbox=",".join(map(str, location["Bbox"])),
118
+ root_collection=root_collection,
119
+ )
132
120
  # Update identifier to use location as well as title
133
121
  # TODO: should we use the name as id? it provides much more
134
122
  # information in the clients
@@ -159,25 +147,18 @@ def handle_STAC_based_endpoint(
159
147
  if isinstance(c_child, Collection):
160
148
  root_collection.extent.spatial.bboxes.append(c_child.extent.spatial.bboxes[0])
161
149
  else:
150
+ bbox = None
162
151
  if "Bbox" in endpoint_config:
163
- root_collection = process_STACAPI_Endpoint(
164
- catalog_config=catalog_config,
165
- endpoint_config=endpoint_config,
166
- collection_config=collection_config,
167
- catalog=catalog,
168
- options=options,
169
- headers=headers,
170
- bbox=",".join(map(str, endpoint_config["Bbox"])),
171
- )
172
- else:
173
- root_collection = process_STACAPI_Endpoint(
174
- catalog_config=catalog_config,
175
- endpoint_config=endpoint_config,
176
- collection_config=collection_config,
177
- catalog=catalog,
178
- options=options,
179
- headers=headers,
180
- )
152
+ bbox = ",".join(map(str, endpoint_config["Bbox"]))
153
+ root_collection = process_STACAPI_Endpoint(
154
+ catalog_config=catalog_config,
155
+ endpoint_config=endpoint_config,
156
+ collection_config=collection_config,
157
+ catalog=catalog,
158
+ options=options,
159
+ headers=headers,
160
+ bbox=bbox,
161
+ )
181
162
 
182
163
  add_example_info(root_collection, collection_config, endpoint_config, catalog_config)
183
164
  return root_collection
@@ -199,6 +180,12 @@ def process_STACAPI_Endpoint(
199
180
  collection = get_or_create_collection(
200
181
  catalog, endpoint_config["CollectionId"], collection_config, catalog_config, endpoint_config
201
182
  )
183
+ datetime_query = ["1900-01-01T00:00:00Z", "3000-01-01T00:00:00Z"]
184
+ if query := endpoint_config.get("Query"):
185
+ if start := query.get("Start"):
186
+ datetime_query[0] = start
187
+ if end := query.get("End"):
188
+ datetime_query[1] = end
202
189
 
203
190
  api = Client.open(endpoint_config["EndPoint"], headers=headers)
204
191
  if bbox is None:
@@ -206,7 +193,7 @@ def process_STACAPI_Endpoint(
206
193
  results = api.search(
207
194
  collections=[endpoint_config["CollectionId"]],
208
195
  bbox=bbox,
209
- datetime=["1900-01-01T00:00:00Z", "3000-01-01T00:00:00Z"],
196
+ datetime=datetime_query, # type: ignore
210
197
  )
211
198
  # We keep track of potential duplicate times in this list
212
199
  added_times = {}
@@ -813,18 +800,18 @@ def handle_raw_source(
813
800
  endpoint_config,
814
801
  item,
815
802
  )
816
- ep_st = endpoint_config["Style"]
817
- style_link = Link(
818
- rel="style",
819
- target=ep_st
820
- if ep_st.startswith("http")
821
- else f"{catalog_config['assets_endpoint']}/{ep_st}",
822
- media_type=style_type,
823
- extra_fields={
824
- "asset:keys": list(assets),
825
- },
826
- )
827
- item.add_link(style_link)
803
+ if ep_st := endpoint_config.get("Style"):
804
+ style_link = Link(
805
+ rel="style",
806
+ target=ep_st
807
+ if ep_st.startswith("http")
808
+ else f"{catalog_config['assets_endpoint']}/{ep_st}",
809
+ media_type=style_type,
810
+ extra_fields={
811
+ "asset:keys": list(assets),
812
+ },
813
+ )
814
+ item.add_link(style_link)
828
815
  link = collection.add_item(item)
829
816
  link.extra_fields["datetime"] = time_entry["Time"]
830
817
  link.extra_fields["assets"] = [a["File"] for a in time_entry["Assets"]]