From 36f2ed431d502d3e52a78b02fd0e0acd0a8564eb Mon Sep 17 00:00:00 2001 From: Lukas Riedel <34276446+peanutfun@users.noreply.github.com> Date: Thu, 17 Aug 2023 11:52:02 +0200 Subject: [PATCH] Fix mutable default values in ImpactFreqCurve --- climada/engine/impact.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/climada/engine/impact.py b/climada/engine/impact.py index 84840c613..39cd327b1 100644 --- a/climada/engine/impact.py +++ b/climada/engine/impact.py @@ -1854,10 +1854,10 @@ class ImpactFreqCurve(): """dictionary of tags of exposures, impact functions set and hazard: {'exp': Tag(), 'impf_set': Tag(), 'haz': Tag()}""" - return_per : np.array = np.array([]) + return_per : np.ndarray = field(default_factory=lambda: np.empty(0)) """return period""" - impact : np.array = np.array([]) + impact : np.ndarray = field(default_factory=lambda: np.empty(0)) """impact exceeding frequency""" unit : str = ''