Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i.eodag: add testsuite #1163

Merged
merged 18 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/apt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ libpng-dev
libproj-dev
libreadline-dev
libzstd-dev
proj-bin
pdal
sqlite3
subversion
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/extra_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
scipy
eodag
pandas
scikit-learn
GDAL==${GDAL_VERSION}
Expand Down
14 changes: 5 additions & 9 deletions src/imagery/i.eodag/i.eodag.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@

import sys
import os
import pytz
import json
import re
from pathlib import Path
Expand Down Expand Up @@ -454,16 +453,13 @@ def normalize_time(datetime_str: str):
:return: Datetime converted to 'YYYY-MM-DDTHH:MM:SS'
:rtype: str
"""
# Remove microseconds
if datetime_str.find("Z") != -1:
datetime_str = datetime_str[: datetime_str.find("Z")]
normalized_datetime = datetime.fromisoformat(datetime_str)
if normalized_datetime.tzinfo is None:
normalized_datetime = normalized_datetime.replace(tzinfo=timezone.utc)
# Remove microseconds
normalized_datetime = normalized_datetime.replace(microsecond=0)
# Convert time to UTC
normalized_datetime = normalized_datetime.astimezone(pytz.utc)
# Remove timezone info
normalized_datetime = normalized_datetime.replace(tzinfo=None)
return normalized_datetime.isoformat()
return normalized_datetime.strftime("%Y-%m-%dT%H:%M:%S")
return normalized_datetime.astimezone(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S")


def no_fallback_search(search_parameters, provider):
Expand Down
8 changes: 8 additions & 0 deletions src/imagery/i.eodag/testsuite/data/ids_list.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
S2B_MSIL2A_20240529T081609_N0510_R121_T37SED_20240529T105453
S2B_MSIL2A_20240529T081609_N0510_R121_T37TDE_20240529T124818



S2B_MSIL2A_20240529T081609_N0510_R121_T37SED_20240529T105453
S2B_MSIL2A_2 0240529T081609_N0510_R121_T37SED_20240529T105453
S2B_MSIL2A _20240526T080609_N0510_R078_T37SDD_20240526T094753
Loading