Use add_dict instead of unified_merge for param study
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
from pyzebra.anatric import *
|
||||
from pyzebra.ccl_findpeaks import ccl_findpeaks
|
||||
from pyzebra.ccl_io import export_comm, load_1D, parse_1D
|
||||
from pyzebra.fit2 import fitccl
|
||||
from pyzebra.h5 import *
|
||||
from pyzebra.ccl_io import load_1D, parse_1D, export_comm
|
||||
from pyzebra.merge_function import unified_merge
|
||||
from pyzebra.merge_function import add_dict, unified_merge
|
||||
from pyzebra.xtal import *
|
||||
|
||||
__version__ = "0.2.0"
|
||||
|
@ -132,7 +132,7 @@ def create():
|
||||
_, ext = os.path.splitext(f_name)
|
||||
if det_data:
|
||||
append_data = pyzebra.parse_1D(file, ext)
|
||||
pyzebra.unified_merge(det_data, append_data)
|
||||
pyzebra.add_dict(det_data, append_data)
|
||||
else:
|
||||
det_data = pyzebra.parse_1D(file, ext)
|
||||
|
||||
@ -146,7 +146,7 @@ def create():
|
||||
with io.StringIO(base64.b64decode(f_str).decode()) as file:
|
||||
_, ext = os.path.splitext(f_name)
|
||||
append_data = pyzebra.parse_1D(file, ext)
|
||||
pyzebra.unified_merge(det_data, append_data)
|
||||
pyzebra.add_dict(det_data, append_data)
|
||||
|
||||
_init_datatable()
|
||||
|
||||
|
@ -280,11 +280,16 @@ def add_dict(dict1, dict2):
|
||||
new_filenames = np.arange(
|
||||
max_measurement_dict1 + 1, max_measurement_dict1 + 1 + len(dict2["scan"])
|
||||
)
|
||||
|
||||
if dict1.get("extra_meta") is None:
|
||||
dict1["extra_meta"] = {}
|
||||
|
||||
new_meta_name = "meta" + str(dict2["meta"]["original_filename"])
|
||||
if new_meta_name not in dict1:
|
||||
for keys, name in zip(dict2["scan"], new_filenames):
|
||||
dict2["scan"][keys]["file_of_origin"] = str(dict2["meta"]["original_filename"])
|
||||
dict1["scan"][name] = dict2["scan"][keys]
|
||||
dict1["extra_meta"][name] = dict2["meta"]
|
||||
|
||||
dict1[new_meta_name] = dict2["meta"]
|
||||
else:
|
||||
|
Reference in New Issue
Block a user