Eliminate zeros in Hazard.get_mdr #966
GitHub Actions / Petals / Unit Test Results (3.9)
failed
Sep 17, 2024 in 0s
1 fail, 2 skipped, 200 pass in 4m 14s
203 tests 200 ✅ 4m 14s ⏱️
1 suites 2 💤
1 files 1 ❌
Results for commit e8dc59b.
Annotations
Check warning on line 0 in climada_petals.engine.test.test_warn.TestWarn
github-actions / Petals / Unit Test Results (3.9)
test_from_hazard (climada_petals.engine.test.test_warn.TestWarn) failed
climada_petals/tests_xml/tests.xml [took 1s]
Raw output
climada.util.api_client.Client.NoConnection: there is no internet connection and the client has not found any cached result for this request.
self = <climada_petals.engine.test.test_warn.TestWarn testMethod=test_from_hazard>
def test_from_hazard(self):
client = Client()
> tc_dataset_infos = client.list_dataset_infos(data_type='tropical_cyclone')
climada_petals/engine/test/test_warn.py:30:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../../micromamba/envs/climada_env_3.9/lib/python3.9/site-packages/climada/util/api_client.py:418: in list_dataset_infos
DatasetInfo.from_json(ds) for ds in self._request_200(url, params=params)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <climada.util.api_client.Client object at 0x7f98582a9340>
url = 'https://climada.ethz.ch/data-api/v2/dataset/'
params = {'data_type': 'tropical_cyclone', 'limit': 100000, 'name': None, 'status': 'active', ...}
def _request_200(self, url, params=None):
"""Helper method, triaging successfull and failing requests.
Returns
-------
dict
loaded from the json object of a successful request.
Raises
------
NoResult
if the response status code is different from 200
"""
# pylint: disable=no-else-return
if params is None:
params = dict()
if self.online:
page = requests.get(url, params=params, timeout=Client.QUERY_TIMEOUT)
if page.status_code != 200:
raise Client.NoResult(page.content.decode())
result = json.loads(page.content.decode())
if self.cache.enabled:
self.cache.store(result, url, **params)
return result
else: # try to restore previous results from an identical request
if not self.cache.enabled:
raise Client.NoConnection(
"there is no internet connection and the client does"
" not cache results."
)
cached_result = self.cache.fetch(url, **params)
if not cached_result:
> raise Client.NoConnection(
"there is no internet connection and the client has not"
" found any cached result for this request."
)
E climada.util.api_client.Client.NoConnection: there is no internet connection and the client has not found any cached result for this request.
../../../../micromamba/envs/climada_env_3.9/lib/python3.9/site-packages/climada/util/api_client.py:341: NoConnection
Loading