Skip to content

Commit 9f6fa28

Browse files
author
kim
committed
Merge branch 'test' into cs.v3-test-suite
2 parents 15653f8 + 88be871 commit 9f6fa28

File tree

7 files changed

+51
-49
lines changed

7 files changed

+51
-49
lines changed

.github/workflows/reusable-DeployStack-SearchAPI.yml

-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ jobs:
101101
run: |
102102
sudo apt-get update
103103
sudo apt-get install libgdal-dev
104-
export SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True
105104
python3 -m pip install --no-cache-dir --upgrade pip
106105
python3 -m pip install --no-cache-dir wheel Cython
107106
python3 -m pip install -r requirements.txt --use-deprecated=legacy-resolver

Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ WORKDIR "${LAMBDA_TASK_ROOT}/Discovery-SearchAPI"
2020
COPY requirements.txt .
2121
RUN mkdir "${LAMBDA_TASK_ROOT}/python-packages"
2222
ENV PYTHONPATH "${PYTHONPATH}:${LAMBDA_TASK_ROOT}/python-packages"
23-
ENV SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True
2423
RUN python3 -m pip install --no-cache-dir -r requirements.txt --target "${LAMBDA_TASK_ROOT}/python-packages"
2524

2625
## Copy required files (Already inside Discovery-SearchAPI dir):

SearchAPI/Baseline/Calc.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from math import sqrt, cos, sin, radians
22
import numpy as np
3-
import dateparser
4-
3+
import ciso8601
54
# WGS84 constants
65
a = 6378137
76
f = pow((1.0 - 1 / 298.257224), 2)
@@ -15,17 +14,17 @@ def calculate_perpendicular_baselines(reference, stack):
1514
product['noStateVectors'] = True
1615
continue
1716

18-
asc_node_time = dateparser.parse(product['ascendingNodeTime']).timestamp()
17+
asc_node_time = ciso8601.parse_datetime(product['ascendingNodeTime']).timestamp()
1918

20-
start = dateparser.parse(product['startTime']).timestamp()
21-
end = dateparser.parse(product['stopTime']).timestamp()
19+
start = ciso8601.parse_datetime(product['startTime']).timestamp()
20+
end = ciso8601.parse_datetime(product['stopTime']).timestamp()
2221
center = start + ((end - start) / 2)
2322
product['relative_start_time'] = start - asc_node_time
2423
product['relative_center_time'] = center - asc_node_time
2524
product['relative_end_time'] = end - asc_node_time
2625

27-
t_pre = dateparser.parse(product['sv_t_pos_pre']).timestamp()
28-
t_post = dateparser.parse(product['sv_t_pos_post']).timestamp()
26+
t_pre = ciso8601.parse_datetime(product['sv_t_pos_pre']).timestamp()
27+
t_post = ciso8601.parse_datetime(product['sv_t_pos_post']).timestamp()
2928
product['relative_sv_pre_time'] = t_pre - asc_node_time
3029
product['relative_sv_post_time'] = t_post - asc_node_time
3130

SearchAPI/Baseline/Stack.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import dateparser
1+
import ciso8601
22
from SearchAPI.CMR.Translate import translate_params, input_fixer
33
from SearchAPI.CMR.Query import CMRQuery
44
from .Calc import calculate_perpendicular_baselines
@@ -178,13 +178,13 @@ def get_default_product_type(reference):
178178
def calculate_temporal_baselines(reference, stack):
179179
for product in stack:
180180
if product['granuleName'] == reference:
181-
reference_start = dateparser.parse(product['startTime'])
181+
reference_start = ciso8601.parse_datetime(product['startTime'])
182182
break
183183
for product in stack:
184184
if product['granuleName'] == reference:
185185
product['temporalBaseline'] = 0
186186
else:
187-
start = dateparser.parse(product['startTime'])
187+
start = ciso8601.parse_datetime(product['startTime'])
188188
product['temporalBaseline'] = (start.date() - reference_start.date()).days
189189
return stack
190190

SearchAPI/CMR/Output/geojson.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ def getItem(self, p):
6464
coordinates = []
6565

6666
if p.get('shape') is not None:
67-
coordinates = [[float(c['lon']), float(c['lat'])] for c in p.get('shape')]
67+
coordinates = [
68+
[[float(c['lon']), float(c['lat'])] for c in p.get('shape')]
69+
]
6870

6971
result = {
7072
'type': 'Feature',

requirements.txt

+35-32
Original file line numberDiff line numberDiff line change
@@ -3,79 +3,79 @@ argcomplete==1.12.3
33
asn1crypto==1.4.0
44
atomicwrites==1.4.0
55
attrs==21.2.0
6-
backports.zoneinfo==0.2.1;python_version<"3.9" # https://stackoverflow.com/questions/71712258/error-could-not-build-wheels-for-backports-zoneinfo-which-is-required-to-insta
6+
blinker==1.7.0
77
boto3==1.19.0
88
botocore==1.22.0
99
Brotli==1.0.9
10-
certifi==2021.10.8
10+
certifi==2023.7.22
1111
cffi==1.15.0
1212
cfn-flip==1.3.0
1313
chardet==4.0.0
1414
charset-normalizer==2.0.7
15-
click==7.1.2
15+
ciso8601==2.3.1
16+
click==8.1.7
1617
click-plugins==1.1.1
1718
cligj==0.7.2
1819
coverage==6.0.2
19-
# cryptography==3.4.7 # Version 35.0.0 breaks zappa=0.52.0 deployments. (yes, their versions went from 3.4.7, 3.4.8, then 35.0.0)
2020
dateparser==1.1.0
2121
DateTime==4.3
2222
defusedxml==0.7.1
2323
Deprecated==1.2.13
2424
docutils==0.17.1
2525
Dumper==1.2.0
2626
durationpy==0.5
27+
exceptiongroup==1.2.1
2728
execnet==1.9.0
28-
Fiona==1.8.20
29-
Flask==2.0.2
29+
fiona==1.9.6
30+
Flask==2.3.2
3031
Flask-Compress==1.10.1
3132
Flask-Cors==3.0.10
3233
flask-lambda-python36==0.1.0
3334
flask-talisman==0.8.1
34-
future==0.18.2
3535
geojson==2.5.0
3636
geomet==0.3.0
37+
geopandas==0.10.0
3738
gitdb==4.0.7
3839
gitdb2==4.0.2
39-
GitPython==3.1.24
40-
gunicorn==20.1.0
40+
GitPython==3.1.41
41+
gunicorn==22.0.0
4142
hjson==3.0.2
4243
hypothesis==6.37.0
4344
idna==3.3
4445
importlib-metadata==4.8.1
45-
iniconfig==1.1.1
46-
itsdangerous==2.0.1
47-
Jinja2==3.0.2
46+
# iniconfig==1.2.1
47+
itsdangerous==2.2.0
48+
Jinja2==3.1.3
4849
jmespath==0.10.0
49-
joblib==1.1.0
50+
joblib==1.2.0
5051
kappa==0.6.0
5152
kml2geojson==4.0.2
5253
lambda-packages==0.20.0
5354
libpagure==0.22
54-
lxml==4.7.1
55-
MarkupSafe==2.0.1
55+
lxml==5.2.1
56+
MarkupSafe==2.1.5
5657
more-itertools==8.10.0
5758
munch==2.5.0
58-
packaging==21.0
59+
numpy==1.22.4
60+
packaging==24.0
5961
pandas==1.3.4
6062
pathlib2==2.3.6
6163
pep517==0.12.0
6264
pexpect==4.8.0
6365
pip-tools==6.4.0
6466
placebo==0.10.0
65-
pluggy==1.0.0
67+
pluggy==1.5.0
6668
ptyprocess==0.7.0
67-
py==1.10.0
6869
pycparser==2.20
6970
PyGithub==1.55
70-
PyJWT==2.3.0
71+
PyJWT==2.4.0
7172
pykml==0.2.0
72-
# PyNaCl==1.4.0 # breaks zappa 0.52.0 (didn't check earlier versions, not sure if we need this)
73-
# pyOpenSSL==21.0.0 # (Requires cryptography, which makes zappa throw)
73+
# PyNaCl==1.5.0
7474
pyparsing==2.4.7
7575
pyproj==3.6.0
7676
pyshp==2.1.3
77-
pytest==6.2.5
78-
pytest-automation==1.1.2
77+
pytest==8.1.1
78+
pytest-automation==3.0.0
7979
pytest-cov==3.0.0
8080
pytest-forked==1.3.0
8181
pytest-xdist==2.4.0
@@ -84,28 +84,31 @@ python-gitlab==2.10.1
8484
python-slugify==5.0.2
8585
pytz==2021.3
8686
pytz-deprecation-shim==0.1.0.post0
87-
PyYAML==6.0
87+
PyYAML==6.0.1
8888
regex==2021.10.8
8989
requests==2.26.0
9090
requests-toolbelt==0.9.1
9191
responses==0.18.0
9292
s3transfer==0.5.0
9393
scandir==1.10.0
94-
scikit-learn==1.1.3 # WARNING: 0.24.1 breaks ShorelineMask26 test
94+
scikit-learn==1.1.3
95+
scipy==1.13.0
9596
serverless-wsgi==3.0.0
9697
Shapely==1.7.1
9798
six==1.16.0
99+
# sklearn==0.0.post5
98100
smmap==4.0.0
101+
sortedcontainers==2.4.0
99102
text-unidecode==1.3
103+
threadpoolctl==3.4.0
100104
toml==0.10.2
101-
tomli==1.2.1
105+
tomli==2.0.1
102106
typing-extensions==3.10.0.2
103107
tzdata==2021.4
104-
tzlocal==2.0.0 # tzlocal.get_localzone() changed it's return type after this (No 'localize' attr)
108+
tzlocal==2.0.0
105109
urllib3==1.26.7
106-
Werkzeug==2.0.2
107-
WKTUtils==1.1.6
108-
wrapt==1.13.2
110+
Werkzeug==2.3.3
111+
WKTUtils==2.0.0
112+
wrapt==1.16.0
109113
zipp==3.6.0
110-
zope.interface==4.7.2
111-
numpy==1.21.3
114+
zope.interface==4.7.2

yml_tests/test_URLs.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -2427,8 +2427,8 @@ tests:
24272427
expected file: csv
24282428
expected code: 200
24292429

2430-
- start yesterday count:
2431-
start: yesterday
2430+
- start 3 days ago count:
2431+
start: 3 days ago
24322432
output: count
24332433

24342434
expected file: count
@@ -2441,8 +2441,8 @@ tests:
24412441
expected file: count
24422442
expected code: 200
24432443

2444-
- start 1dayago count:
2445-
start: 1+day+ago
2444+
- start 3daysago count:
2445+
start: 3+days+ago
24462446
output: count
24472447

24482448
expected file: count

0 commit comments

Comments
 (0)