diff --git a/climada/conf/climada.conf b/climada/conf/climada.conf index ba7163378..f80b5ae4a 100644 --- a/climada/conf/climada.conf +++ b/climada/conf/climada.conf @@ -59,7 +59,7 @@ "log_level": "WARNING", "max_matrix_size": 1000000000, "data_api": { - "url": "https://climada.ethz.ch/data-api/v1/", + "url": "https://climada.ethz.ch/data-api/v2/", "chunk_size": 8192, "cache_db": "{local_data.system}/.downloads.db", "cache_enabled": true, diff --git a/climada/util/api_client.py b/climada/util/api_client.py index 02eacd657..950621d52 100644 --- a/climada/util/api_client.py +++ b/climada/util/api_client.py @@ -83,6 +83,8 @@ class DataTypeInfo(): status: str description:str properties:list # of dict + key_reference:list = None + version_notes:list = None @dataclass @@ -371,7 +373,7 @@ def list_dataset_infos(self, data_type=None, name=None, version=None, properties ------- list of DatasetInfo """ - url = f'{self.url}/dataset' + url = f'{self.url}/dataset/' params = { 'data_type': data_type, 'name': name, @@ -458,7 +460,7 @@ def get_dataset_info_by_uuid(self, uuid): NoResult if the uuid is not valid """ - url = f'{self.url}/dataset/{uuid}' + url = f'{self.url}/dataset/{uuid}/' return DatasetInfo.from_json(self._request_200(url)) def list_data_type_infos(self, data_type_group=None): @@ -474,7 +476,7 @@ def list_data_type_infos(self, data_type_group=None): ------- list of DataTypeInfo """ - url = f'{self.url}/data_type' + url = f'{self.url}/data_type/' params = {'data_type_group': data_type_group} \ if data_type_group else {} return [DataTypeInfo(**jobj) for jobj in self._request_200(url, params=params)] @@ -496,7 +498,7 @@ def get_data_type_info(self, data_type): NoResult if there is no such data type registered """ - url = f'{self.url}/data_type/{quote(data_type)}' + url = f'{self.url}/data_type/{quote(data_type)}/' return DataTypeInfo(**self._request_200(url)) def _download(self, url, path, replace=False):