diff --git a/src/hdmf/container.py b/src/hdmf/container.py index 8420805cb..fdc4937df 100644 --- a/src/hdmf/container.py +++ b/src/hdmf/container.py @@ -4,6 +4,7 @@ from copy import deepcopy from uuid import uuid4 from warnings import warn +from typing import Type import h5py import numpy as np @@ -789,6 +790,15 @@ def set_dataio(self, **kwargs): dataio.data = self.__data self.__data = dataio + @docval( + {'name': 'data_io_class', 'type': Type[DataIO], 'doc': 'The DataIO to apply to the data held by this Data.'} + {'name': 'data_io_kwargs', 'type': dict, 'doc': 'The keyword arguments to pass to the DataIO.'} + ) + def set_data_io(self, **kwargs): + """Apply DataIO object to the data held by this Data object.""" + data_io_class, data_io_kwargs = getargs('data_io_class', 'data_io_kwargs', kwargs) + self.__data = data_io_class(data=self.__data, **data_io_kwargs) + @docval({'name': 'func', 'type': types.FunctionType, 'doc': 'a function to transform *data*'}) def transform(self, **kwargs): """