def time_series_h5(timefile, colnames):
if not timefile.is_file():<EOL><INDENT>return None<EOL><DEDENT>with h5py.File(timefile, '<STR_LIT:r>') as h5f:<EOL><INDENT>dset = h5f['<STR_LIT>']<EOL>_, ncols = dset.shape<EOL>ncols -= <NUM_LIT:1>  <EOL>h5names = map(bytes.decode, h5f['<STR_LIT>'][len(colnames) + <NUM_LIT:1>:])<EOL>_tidy_names(colnames, ncols, h5names)<EOL>data = dset[()]<EOL><DEDENT>return pd.DataFrame(data[:, <NUM_LIT:1>:],<EOL>index=np.int_(data[:, <NUM_LIT:0>]), columns=colnames)<EOL>
Read temporal series HDF5 file.

    If :data:`colnames` is too long, it will be truncated. If it is too short,
    additional column names will be deduced from the content of the file.

    Args:
        timefile (:class:`pathlib.Path`): path of the TimeSeries.h5 file.
        colnames (list of names): names of the variables expected in
            :data:`timefile` (may be modified).

    Returns:
        :class:`pandas.DataFrame`:
            Time series, with the variables in columns and the time steps in
            rows.