Commit 5c2e54a6 authored by Henri Payno's avatar Henri Payno
Browse files

[dicth52nx] fix deprecation warning due to update_mode parameter

parent b2848a10
......@@ -403,13 +403,15 @@ def write_xas_proc(
value,
h5file=h5_file,
h5path=h5_path,
overwrite_data=True,
update_mode="replace",
mode="a",
)
else:
with HDF5File(h5_file, "a") as h5f:
nx_process = h5f.require_group(nx_process_path)
if attrs is None:
if key_path in nx_process:
del nx_process[key_path]
try:
nx_process[key_path] = value
except TypeError as e:
......@@ -452,6 +454,9 @@ def write_xas_proc(
# to insure silx isplotting it we should have curve as a 1D object
# but by default we are handling a map of spectra. This is why we
# need to duplicate data here
if name in plot_group:
del plot_group[name]
if dataset_to_link.ndim == 1:
plot_group[name] = h5py.SoftLink(dataset_to_link.name)
elif dataset_to_link.ndim == 2:
......@@ -538,7 +543,7 @@ def write_xas_proc(
process.getConfiguration(),
h5file=h5_file,
h5path=h5_path,
overwrite_data=True,
update_mode="add",
mode="a",
)
......@@ -614,7 +619,7 @@ def write_spectrum_saving_pt(h5_file, entry, obj, overwrite=True):
:param str obj_name: name of the object to store
:param str data_path:
"""
dicttoh5(obj, h5file=h5_file, h5path=entry, overwrite_data=True, mode="a")
dicttoh5(obj, h5file=h5_file, h5path=entry, update_mode="replace", mode="a")
def get_xasproc(h5_file, entry):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment