We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e7efbe commit a3eb399Copy full SHA for a3eb399
climada/engine/impact.py
@@ -1716,13 +1716,9 @@ def from_hdf5(
1716
array_attrs = array_attrs.intersection(file.keys())
1717
kwargs.update({attr: file[attr][:] for attr in array_attrs})
1718
# correct lead_time attribut to timedelta
1719
- if "lead_time" in array_attrs:
1720
- kwargs.update(
1721
- {
1722
- "lead_time": np.array(file["lead_time"][:]).astype(
1723
- "timedelta64[ns]"
1724
- )
1725
- }
+ if "lead_time" in kwargs:
+ kwargs["lead_time"] = np.array(file["lead_time"][:]).astype(
+ "timedelta64[ns]"
1726
)
1727
# Special handling for 'event_name' because it should be a list of strings
1728
if "event_name" in file:
0 commit comments