Skip to content

Commit

Permalink
Merge pull request #23 from DimitriPapadopoulos/dataclass
Browse files Browse the repository at this point in the history
Avoid mutable default values with @DataClass
  • Loading branch information
wtclarke authored Jan 10, 2023
2 parents 738b256 + 611f154 commit 9a5d222
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mapvbvd/twix_map_obj.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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':
Expand Down

0 comments on commit 9a5d222

Please sign in to comment.