Merge branch 'develop' into feature/from_netcdf_fast #1112
GitHub Actions / Core / Unit Test Results (3.9)
failed
Dec 13, 2024 in 0s
1 fail, 711 pass in 8m 41s
Annotations
Check warning on line 0 in climada.hazard.test.test_tc_tracks.TestIO
github-actions / Core / Unit Test Results (3.9)
test_from_netcdf_fast (climada.hazard.test.test_tc_tracks.TestIO) failed
tests_xml/tests.xml [took 0s]
Raw output
AssertionError: {'max[42 chars]ssure_unit': 'hPa', 'data_provider': 'FAST', '[47 chars]: -1} != {'max[42 chars]ssure': 'hPa', 'data_provider': 'FAST', 'orig_[42 chars]: -1}
{'category': -1,
- 'central_pressure_unit': 'hPa',
? -----
+ 'central_pressure': 'hPa',
'data_provider': 'FAST',
'id_no': 0,
'max_sustained_wind_unit': 'm/s',
'orig_event_flag': False}
self = <climada.hazard.test.test_tc_tracks.TestIO testMethod=test_from_netcdf_fast>
def test_from_netcdf_fast(self):
"""test the import of netcdf files from fast model"""
# create dummy .nc file to be read
file_path = DATA_DIR.joinpath("fast_test_tracks.nc")
TEST_TRACKS_FAST_dummy.to_netcdf(file_path)
tc_track = tc.TCTracks.from_netcdf_fast(file_path)
expected_attributes = {
"max_sustained_wind_unit": "m/s",
"central_pressure": "hPa",
"data_provider": "FAST",
"orig_event_flag": False,
"id_no": 0,
"category": -1,
}
self.assertIsInstance(
tc_track, tc.TCTracks, "tc_track is not an instance of TCTracks"
)
self.assertIsInstance(
tc_track.data, list, "tc_track.data is not an instance of list"
)
self.assertIsInstance(
tc_track.data[0],
xr.Dataset,
"tc_track.data[0] not an instance of xarray.Dataset",
)
self.assertEqual(len(tc_track.data), 20)
> self.assertEqual(tc_track.data[0].attrs, expected_attributes)
E AssertionError: {'max[42 chars]ssure_unit': 'hPa', 'data_provider': 'FAST', '[47 chars]: -1} != {'max[42 chars]ssure': 'hPa', 'data_provider': 'FAST', 'orig_[42 chars]: -1}
E {'category': -1,
E - 'central_pressure_unit': 'hPa',
E ? -----
E
E + 'central_pressure': 'hPa',
E 'data_provider': 'FAST',
E 'id_no': 0,
E 'max_sustained_wind_unit': 'm/s',
E 'orig_event_flag': False}
climada/hazard/test/test_tc_tracks.py:698: AssertionError
Loading