Skip to content

Commit

Permalink
fix regression: temporary dict needs to be built from scratch
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Muenker <mail@chipmuenk.de>
  • Loading branch information
chipmuenk committed May 20, 2024
1 parent f3192d1 commit cc8ef66
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pyfda/libs/pyfda_io_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1620,6 +1620,7 @@ def load_filter(self, all=False) -> int:
try:
with io.open(file_name, 'rb') as f: # open in binary mode for npy and pkl
if file_type == 'npz':
fb_temp = {}
# array containing dict, dtype 'object':
arr = np.load(f, allow_pickle=True)
logger.warning(f"Load 'npz', returned type is {type(arr)}.")
Expand All @@ -1628,10 +1629,10 @@ def load_filter(self, all=False) -> int:
for key in sorted(arr):
if np.ndim(arr[key]) == 0:
# scalar objects may be extracted with the item() method
fb_temp[key] = arr[key].item()
fb_temp.update({key: arr[key].item()})
else:
# array objects are converted to list first
fb_temp[key] = arr[key].tolist()
fb_temp.update({key: arr[key].tolist()})
else: # file_type == 'pkl':
fb_temp = pickle.load(f)

Expand Down

0 comments on commit cc8ef66

Please sign in to comment.