Commit 926ed4c3 authored by payno's avatar payno

[fix io] replace several `w` opening mode by `a`

parent 25e73898
Pipeline #14853 failed with stage
in 5 minutes and 49 seconds
......@@ -85,7 +85,7 @@ class TestNormalizationMultipleSpectrum(unittest.TestCase):
spectra_path = '/data/NXdata/data'
channel_path = '/data/NXdata/Channel'
filename = os.path.join(self.output_dir, 'myfile.h5')
with h5py.File(filename, 'w') as f:
with h5py.File(filename, 'a') as f:
f[spectra_path] = self.spectra
f[channel_path] = self.energy
......
......@@ -49,7 +49,7 @@ class TestRoi(unittest.TestCase):
spectra_path = '/data/NXdata/data'
channel_path = '/data/NXdata/Channel'
filename = os.path.join(self.output_dir, 'myfile.h5')
with h5py.File(filename, 'w') as f:
with h5py.File(filename, 'a') as f:
f[spectra_path] = self.spectra
f[channel_path] = self.energy
......
......@@ -100,7 +100,7 @@ class TestXASObject(unittest.TestCase):
spectra_path = '/data/NXdata/data'
channel_path = '/data/NXdata/Channel'
filename = os.path.join(self.output_dir, 'myfile.h5')
with h5py.File(filename, 'w') as f:
with h5py.File(filename, 'a') as f:
f[spectra_path] = self.spectra
f[channel_path] = self.energy
......
......@@ -489,7 +489,7 @@ class XASObject(object):
'stored')
else:
process_flow = self.get_process_flow()
with h5py.File(self.linked_h5_file, 'w') as h5f:
with h5py.File(self.linked_h5_file, 'a') as h5f:
for index, process_ in process_flow.items():
del h5f[process_['_h5py_path']]
......@@ -505,8 +505,8 @@ class XASObject(object):
flow = self.get_process_flow()
entry = self.entry
with h5py.File(self.__h5_file, 'w') as source_hdf:
with h5py.File(h5_file_target, 'w') as target_hdf:
with h5py.File(self.__h5_file, 'a') as source_hdf:
with h5py.File(h5_file_target, 'a') as target_hdf:
target_entry = target_hdf.require_group(entry)
def remove_entry_prefix(name):
return name.replace('/'+entry+'/', '', 1)
......
......@@ -148,7 +148,7 @@ def write_xas_proc(h5_file, entry, process, data, processing_order,
"""
process_name = 'xas_process_' + str(processing_order)
# write the xasproc
with h5py.File(h5_file, 'w') as h5f:
with h5py.File(h5_file, 'a') as h5f:
nx_entry = h5f.require_group('/'.join((data_path, entry)))
nx_entry.attrs["NX_class"] = "NXentry"
......@@ -216,7 +216,7 @@ def write_xas(h5_file, entry, energy, mu, sample=None, start_time=None,
:param str title: experiment title
:param str definition: experiment definition
"""
with h5py.File(h5_file, 'w') as h5f:
with h5py.File(h5_file, 'a') as h5f:
nx_entry = h5f.require_group('/'.join((data_path, entry)))
nx_entry.attrs["NX_class"] = "NXentry"
......@@ -297,7 +297,7 @@ def get_xasproc(h5_file, entry):
return res
res = []
with h5py.File(h5_file, 'w') as h5f:
with h5py.File(h5_file, 'a') as h5f:
try:
root_group = h5f[entry]
except KeyError:
......
......@@ -44,9 +44,9 @@ WIDGET_HELP_PATH = (
# Documentation included in wheel
# Correct DATA_FILES entry is needed in setup.py and documentation has to be built
# # before the wheel is created.
("{}/help/xas/index.html".format(sysconfig.get_path("data")), None),
("{}/help/est/index.html".format(sysconfig.get_path("data")), None),
("http://www.silx.org/pub/doc/xas/.htmlhelp/latest/", ""),
("http://www.silx.org/pub/doc/est/.htmlhelp/latest/", ""),
)
......
Markdown is supported
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