File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff 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 ])
You can’t perform that action at this time.
0 commit comments