Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…python into develop
  • Loading branch information
emanuel-schmid committed Mar 20, 2023
2 parents 5694735 + 86f4468 commit fd32ff5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion climada/conf/climada.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 6 additions & 4 deletions climada/util/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ class DataTypeInfo():
status: str
description:str
properties:list # of dict
key_reference:list = None
version_notes:list = None


@dataclass
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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):
Expand All @@ -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)]
Expand All @@ -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):
Expand Down

0 comments on commit fd32ff5

Please sign in to comment.