Skip to content

Commit e123b7b

Browse files
implement code review
1 parent 34612c5 commit e123b7b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

climada/hazard/test/test_forecast.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ def test_write_read_hazard_forecast(haz_fc, tmp_path):
116116
haz_fc.write_hdf5(file_name)
117117
haz_fc_read = HazardForecast.from_hdf5(file_name)
118118

119-
assert haz_fc_read.lead_time.dtype == np.dtype("timedelta64[ns]")
120-
assert haz_fc_read.member.dtype == int
119+
assert haz_fc_read.lead_time.dtype.kind == np.dtype("timedelta64").kind
120+
121121
for key in haz_fc.__dict__.keys():
122-
if key not in ["intensity", "fraction"]:
123-
npt.assert_array_equal(haz_fc.__dict__[key], haz_fc_read.__dict__[key])
124-
else:
122+
if key in ["intensity", "fraction"]:
125123
(haz_fc.__dict__[key] != haz_fc_read.__dict__[key]).nnz == 0
124+
else:
125+
npt.assert_array_equal(haz_fc.__dict__[key], haz_fc_read.__dict__[key])

0 commit comments

Comments
 (0)