File tree 1 file changed +9
-6
lines changed
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 40
40
"variability" ,
41
41
)
42
42
43
- API_URL = "https://cds.climate.copernicus.eu/api/v2 "
43
+ API_URL = "https://cds.climate.copernicus.eu/api/catalogue/v1/collections "
44
44
45
45
46
46
def main (paths : list [Path ]) -> None :
@@ -50,7 +50,7 @@ def main(paths: list[Path]) -> None:
50
50
assert len (segments ) == 4 , f"{ path = !s} : Invalid { path .name = } "
51
51
(
52
52
data_type ,
53
- dataset_id ,
53
+ collection_id ,
54
54
assessment_category ,
55
55
question_number ,
56
56
) = segments
@@ -64,10 +64,13 @@ def main(paths: list[Path]) -> None:
64
64
assert folder in path .parts [folder_index ], f"{ path = !s} : Invalid { folder = } "
65
65
66
66
# Check dataset ID
67
- url = f"{ API_URL } /resources/dataset/{ dataset_id } "
68
- assert (
69
- urllib .request .urlopen (url ).getcode () == 200
70
- ), f"{ path = !s} : Invalid { dataset_id = } "
67
+ url = "/" .join ([API_URL , collection_id ])
68
+ code = None
69
+ try :
70
+ code = urllib .request .urlopen (url ).getcode ()
71
+ except Exception :
72
+ pass
73
+ assert code == 200 , f"{ path = !s} : Invalid { collection_id = } "
71
74
72
75
# Check assessment category
73
76
assert (
You can’t perform that action at this time.
0 commit comments