Writing HDF5 ValueError
Created by: sancholp
I am trying to save a TimeSeries
as HDF5 but am getting a ValueError
(see stack trace). The file gets written to the correct directory, but when trying to read it, I get the similar error ValueError: Please specify the HDF5 path via the ``path=`` keyword argument
.
I am simply writing the file with timeseries.write('file.hdf5', overwrite=True)
.
Any help would be much appreciated.
Traceback (most recent call last):
File "/path/scripts/main.py", line 31, in <module>
main(darm, aux_list)
File "/path/scripts/main.py", line 22, in main
plot_data_cleaning(darm, aux_list)
File "/path/scripts/plotting.py", line 40, in plot_data_cleaning
write_clean_darm_data(cleaned_data[list(cleaned_data)[-1]])
File "/path/scripts/timeseries_io.py", line 102, in write_clean_darm_data
darm.write(file_name, overwrite=True)
File "/Users/miniconda3/envs/igwn-py310/lib/python3.10/site-packages/gwpy/timeseries/core.py", line 329, in write
return io_registry.write(self, target, *args, **kwargs)
File "/Users/miniconda3/envs/igwn-py310/lib/python3.10/site-packages/astropy/io/registry/compat.py", line 52, in wrapper
return getattr(registry, method_name)(*args, **kwargs)
File "/Users/miniconda3/envs/igwn-py310/lib/python3.10/site-packages/astropy/io/registry/core.py", line 383, in write
return writer(data, *args, **kwargs)
File "/Users/miniconda3/envs/igwn-py310/lib/python3.10/site-packages/gwpy/types/io/hdf5.py", line 234, in write_hdf5_series
return write_hdf5_array(series, output, path=path, attrs=attrs, **kwargs)
File "/Users/miniconda3/envs/igwn-py310/lib/python3.10/site-packages/gwpy/io/hdf5.py", line 126, in decorated_func
return func(obj, h5f, *args, **kwargs)
File "/Users/miniconda3/envs/igwn-py310/lib/python3.10/site-packages/gwpy/types/io/hdf5.py", line 182, in write_hdf5_array
raise ValueError("Cannot determine HDF5 path for %s, "
ValueError: Cannot determine HDF5 path for TimeSeries, please set ``name`` attribute, or pass ``path=`` keyword when writing