From d24370bc069eb96fb2aa746308c278aab2e6b724 Mon Sep 17 00:00:00 2001 From: dh00601 <dh00601@surrey.ac.uk> Date: Sat, 16 Oct 2021 19:00:15 +0100 Subject: [PATCH] bugfix for the merge dict function --- binarycpython/utils/functions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/binarycpython/utils/functions.py b/binarycpython/utils/functions.py index fc107281a..078611421 100644 --- a/binarycpython/utils/functions.py +++ b/binarycpython/utils/functions.py @@ -1736,12 +1736,12 @@ def merge_dicts(dict_1: dict, dict_2: dict) -> dict: # floats will be added, lists will be appended (though that might change) and dicts will be # dealt with by calling this function again. else: - # ints # Booleans (has to be the type Bool, not just a 0 or 1) if isinstance(dict_1[key], bool) and isinstance(dict_2[key], bool): new_dict[key] = dict_1[key] or dict_2[key] - elif isinstance(dict_1[key], int) and isinstance(dict_2[key], int): + # ints + elif isinstance(dict_1[key], (int, np.int64)) and isinstance(dict_2[key], (int, np.int64)): new_dict[key] = dict_1[key] + dict_2[key] # floats -- GitLab