Beispiel #1
0
 def _get_data(self,
               data: Data,
               frame: int = None,
               time: float = None,
               index: int = None,
               **kwargs) -> None:
     # pylint: disable=arguments-differ
     if frame is not None and not data:
         data.datasource_argument = 'frame'
         data.datasource_value = frame
         index = frame
     elif time is not None and not data:
         data.datasource_argument = 'time'
         data.datasource_value = time
         index = self._backend.frame_at(time)
     super()._get_data(data, index=index, **kwargs)
Beispiel #2
0
 def _get_meta(self, data: Data, filename: str = None, **kwargs) -> None:
     # pylint: disable=arguments-differ
     if filename is not None and not data.datasource_argument:
         data.datasource_argument = 'filename'
         data.datasource_value = filename
     data.add_attribute('filename', batch=True)
     if self._filenames is not None:
         data.add_attribute('index', batch=True)
     if self._loader_kind != 'array':
         data.add_attribute(self._loader_kind, batch=True)
     super()._get_meta(data, **kwargs)