From 611f154b1a5ee7a9b1886dc67375357d8a95097f Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Wed, 7 Dec 2022 10:36:02 +0100 Subject: [PATCH] Avoid mutable default values with @dataclass --- mapvbvd/twix_map_obj.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mapvbvd/twix_map_obj.py b/mapvbvd/twix_map_obj.py index b40f58f..5175114 100644 --- a/mapvbvd/twix_map_obj.py +++ b/mapvbvd/twix_map_obj.py @@ -1,7 +1,7 @@ import copy import logging import time -from dataclasses import dataclass +from dataclasses import dataclass, field import numpy as np from scipy.interpolate import RectBivariateSpline @@ -199,8 +199,8 @@ class FRI: szScanHeader: int # bytes szChannelHeader: int # bytes iceParamSz: int - sz: np.array = np.zeros(2) - shape: np.array = np.zeros(2) + sz: np.array = field(default_factory=lambda: np.zeros(2)) + shape: np.array = field(default_factory=lambda: np.zeros(2)) cut: np.array = None if self.softwareVersion == 'vb':