diff --git a/CHANGES.md b/CHANGES.md index c47e4d54..39d5bc0d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,7 +10,8 @@ - FIX: Fix iceye product when extent file (*.kml) not found ([#135](https://github.com/sertit/eoreader/pull/135)) - FIX: Add missing `pystac[validation]` in setup.py - FIX: Handle RCM and RS2 products that doesn't bundle their extent in a KML file ([#155](https://github.com/sertit/eoreader/issues/155)) -- CI: Fix S3 endpoint management with `sertit==1.37` +- OPTIM: Search correctly nested metadata in the Reader (without accidentally using a recursive glob) +- CI: Fix S3 endpoint management with `sertit>=1.37` ## 0.21.1 (2024-04-03) diff --git a/eoreader/reader.py b/eoreader/reader.py index d4d474ad..888ec37a 100644 --- a/eoreader/reader.py +++ b/eoreader/reader.py @@ -301,7 +301,7 @@ class Constellation(ListEnum): # File that can be found at any level (product/**/file) "regex": r".*s1[ab]-(iw|ew|sm|wv|s\d)\d*-(raw|slc|grd|ocn)-[hv]{2}-\d{8}t\d{6}-\d{8}t\d{6}-\d{6}-\w{6}-\d{3}(-cog|)\.xml", }, - Constellation.S2: {"nested": 3, "regex": r"MTD_TL.xml"}, + Constellation.S2: {"nested": 2, "regex": r"MTD_TL.xml"}, Constellation.S2_E84: rf"{CONSTELLATION_REGEX[Constellation.S2_E84]}\.json", Constellation.S2_THEIA: rf"{CONSTELLATION_REGEX[Constellation.S2_THEIA]}_MTD_ALL\.xml", Constellation.S3_OLCI: r"Oa\d{2}_radiance.nc", @@ -807,7 +807,7 @@ def valid_mtd( ) else: nested_wildcard = "/".join(["*" for _ in range(nested)]) - prod_files = list(product_path.glob(f"*{nested_wildcard}/*.*")) + prod_files = list(product_path.glob(f"{nested_wildcard}/*.*")) # Archive else: