Skip to content

Commit

Permalink
OPTIM: Search correctly nested metadata in the Reader (without accide…
Browse files Browse the repository at this point in the history
…ntally using a recursive glob)
  • Loading branch information
remi-braun committed Jul 9, 2024
1 parent 1c3d50f commit d744f98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions eoreader/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit d744f98

Please sign in to comment.