eodash_catalog 0.0.31__py3-none-any.whl → 0.0.33__py3-none-any.whl

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.

@@ -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.31"
4
+ __version__ = "0.0.33"
@@ -93,7 +93,10 @@ def process_STAC_Datacube_Endpoint(
93
93
  unit = variables.get(endpoint_config.get("Variable")).get("unit")
94
94
  if unit and "yAxis" not in collection_config:
95
95
  collection_config["yAxis"] = unit
96
- collection.update_extent_from_items()
96
+ if datetimes:
97
+ collection.update_extent_from_items()
98
+ else:
99
+ LOGGER.warn(f"NO datetimes returned for collection: {collection_id}!")
97
100
 
98
101
  add_collection_information(catalog_config, collection, collection_config)
99
102
 
@@ -188,8 +191,9 @@ def process_STACAPI_Endpoint(
188
191
  ) -> Collection:
189
192
  if headers is None:
190
193
  headers = {}
194
+ collection_id = endpoint_config["CollectionId"]
191
195
  collection = get_or_create_collection(
192
- catalog, endpoint_config["CollectionId"], collection_config, catalog_config, endpoint_config
196
+ catalog, collection_id, collection_config, catalog_config, endpoint_config
193
197
  )
194
198
  datetime_query = ["1900-01-01T00:00:00Z", "3000-01-01T00:00:00Z"]
195
199
  if query := endpoint_config.get("Query"):
@@ -202,7 +206,7 @@ def process_STACAPI_Endpoint(
202
206
  if bbox is None:
203
207
  bbox = [-180, -90, 180, 90]
204
208
  results = api.search(
205
- collections=[endpoint_config["CollectionId"]],
209
+ collections=[collection_id],
206
210
  bbox=bbox,
207
211
  datetime=datetime_query, # type: ignore
208
212
  )
@@ -244,7 +248,10 @@ def process_STACAPI_Endpoint(
244
248
  item,
245
249
  collection_config,
246
250
  endpoint_config,
247
- datetimes=[item.properties["start_datetime"], item.properties["end_datetime"]],
251
+ datetimes=[
252
+ parse_datestring_to_tz_aware_datetime(item.properties["start_datetime"]),
253
+ parse_datestring_to_tz_aware_datetime(item.properties["end_datetime"]),
254
+ ],
248
255
  )
249
256
  # If a root collection exists we point back to it from the item
250
257
  if root_collection:
@@ -253,17 +260,25 @@ def process_STACAPI_Endpoint(
253
260
  # bubble up information we want to the link
254
261
  # it is possible for datetime to be null, if it is start and end datetime have to exist
255
262
  if item_datetime:
256
- iso_time = format_datetime_to_isostring_zulu(item_datetime)
257
- link.extra_fields["datetime"] = iso_time
263
+ link.extra_fields["datetime"] = format_datetime_to_isostring_zulu(item_datetime)
258
264
  else:
259
- link.extra_fields["start_datetime"] = item.properties["start_datetime"]
260
- link.extra_fields["end_datetime"] = item.properties["end_datetime"]
265
+ link.extra_fields["start_datetime"] = format_datetime_to_isostring_zulu(
266
+ parse_datestring_to_tz_aware_datetime(item.properties["start_datetime"])
267
+ )
268
+ link.extra_fields["end_datetime"] = format_datetime_to_isostring_zulu(
269
+ parse_datestring_to_tz_aware_datetime(item.properties["end_datetime"])
270
+ )
261
271
  add_projection_info(
262
272
  endpoint_config,
263
273
  item,
264
274
  )
265
- collection.update_extent_from_items()
266
-
275
+ if added_times:
276
+ collection.update_extent_from_items()
277
+ else:
278
+ LOGGER.warn(
279
+ f"""NO items returned for
280
+ bbox: {bbox}, datetime: {datetime_query}, collection: {collection_id}!"""
281
+ )
267
282
  # replace SH identifier with catalog identifier
268
283
  collection.id = collection_config["Name"]
269
284
  add_collection_information(catalog_config, collection, collection_config)
@@ -359,7 +374,10 @@ def handle_SH_WMS_endpoint(
359
374
  link.extra_fields["latlng"] = latlng
360
375
  link.extra_fields["country"] = location["Country"]
361
376
  link.extra_fields["city"] = location["Name"]
362
- collection.update_extent_from_items()
377
+ if location["Times"]:
378
+ collection.update_extent_from_items()
379
+ else:
380
+ LOGGER.warn(f"NO datetimes configured for collection: {collection_config['Name']}!")
363
381
  add_visualization_info(collection, collection_config, endpoint_config)
364
382
 
365
383
  root_collection.update_extent_from_items()
@@ -565,6 +583,8 @@ def handle_WMS_endpoint(
565
583
  link = collection.add_item(item)
566
584
  link.extra_fields["datetime"] = format_datetime_to_isostring_zulu(dt)
567
585
  collection.update_extent_from_items()
586
+ else:
587
+ LOGGER.warn(f"NO datetimes returned for collection: {collection_config['Name']}!")
568
588
 
569
589
  # Check if we should overwrite bbox
570
590
  if "OverwriteBBox" in endpoint_config:
@@ -907,6 +927,9 @@ def handle_raw_source(
907
927
  # eodash v4 compatibility, adding last referenced style to collection
908
928
  if style_link:
909
929
  collection.add_link(style_link)
930
+ collection.update_extent_from_items()
931
+ else:
932
+ LOGGER.warn(f"NO datetimes configured for collection: {collection_config['Name']}!")
933
+
910
934
  add_collection_information(catalog_config, collection, collection_config)
911
- collection.update_extent_from_items()
912
935
  return collection
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: eodash_catalog
3
- Version: 0.0.31
3
+ Version: 0.0.33
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,14 +1,14 @@
1
- eodash_catalog/__about__.py,sha256=2R7896gL7ALer0-0Y74Md4u_pI_bdOqw_xast7f6AL4,138
1
+ eodash_catalog/__about__.py,sha256=j57hF8Yn2PcqwsXR_XEyWVbb1WILN8CcZweHPwFjEC8,138
2
2
  eodash_catalog/__init__.py,sha256=_W_9emPYf6FUqc0P8L2SmADx6hGSd7PlQV3yRmCk5uM,115
3
3
  eodash_catalog/duration.py,sha256=B6XOZfvNU7SuqpxuVtT1kNKODoOQJXDI6mocvA_U1ik,10816
4
- eodash_catalog/endpoints.py,sha256=6CRxWsANyNJZ3XCm9cZRaXBeiLq4pTeURXqhF-sn8yI,36695
4
+ eodash_catalog/endpoints.py,sha256=ByEh0qm9-mv3vTt2XbQamnPF9gQkSayByvATbBJiEF0,37689
5
5
  eodash_catalog/generate_indicators.py,sha256=0IHhu_0yOUoUtLqiTsoYQ2IrTrq00yZme3UE6pC9PIU,19772
6
6
  eodash_catalog/sh_endpoint.py,sha256=F99LpYT-MGhPiwdSSysm3xBTjaQBXRUkieh-q-vhTvE,1012
7
7
  eodash_catalog/stac_handling.py,sha256=2iJwBbsBZIBqGWOdnpIfSug0SoOjbkutpSbWAeQRECU,17828
8
8
  eodash_catalog/thumbnails.py,sha256=qZDcpQe80ki6lEMKYdZtSnnHH0PUpcoXTvU9bYdPlzU,2260
9
9
  eodash_catalog/utils.py,sha256=YBB-cfS_Z4ErMAuBVizBQg18IMIxJb4amW1MfDGExg0,11666
10
- eodash_catalog-0.0.31.dist-info/METADATA,sha256=qYnvOkhkQCOF6je-RusNd6R9yzCtXYEPamwMd2ax_Zw,3203
11
- eodash_catalog-0.0.31.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
12
- eodash_catalog-0.0.31.dist-info/entry_points.txt,sha256=kuUQrDG1PtYd8kPjf5XM6H_NtQd9Ozwl0jjiGtAvZSM,87
13
- eodash_catalog-0.0.31.dist-info/licenses/LICENSE.txt,sha256=oJCW5zQxnFD-J0hGz6Zh5Lkpdk1oAndmWhseTmV224E,1107
14
- eodash_catalog-0.0.31.dist-info/RECORD,,
10
+ eodash_catalog-0.0.33.dist-info/METADATA,sha256=ZOMKPBKdBvbTB7MILMx-FKfiFVqaUcGLcmOOGrC7Hek,3203
11
+ eodash_catalog-0.0.33.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
12
+ eodash_catalog-0.0.33.dist-info/entry_points.txt,sha256=kuUQrDG1PtYd8kPjf5XM6H_NtQd9Ozwl0jjiGtAvZSM,87
13
+ eodash_catalog-0.0.33.dist-info/licenses/LICENSE.txt,sha256=oJCW5zQxnFD-J0hGz6Zh5Lkpdk1oAndmWhseTmV224E,1107
14
+ eodash_catalog-0.0.33.dist-info/RECORD,,