[docs]classDelayedSample:"""Representation of sample that can be loaded via a callable. The optional ``**kwargs`` argument allows you to attach more attributes to this sample instance. Parameters ---------- load : object A python function that can be called parameterlessly, to load the sample in question from whatever medium parent : :py:class:`DelayedSample`, :py:class:`Sample`, None If passed, consider this as a parent of this sample, to copy information kwargs : dict Further attributes of this sample, to be stored and eventually transmitted to transformed versions of the sample """def__init__(self,load,parent=None,**kwargs):self.load=loadifparentisnotNone:_copy_attributes(self,parent.__dict__)_copy_attributes(self,kwargs)@propertydefdata(self):"""Loads the data from the disk file."""returnself.load()def__setattr__(self,name:str,value:Any)->None:returnsuper().__setattr__(name,value)def__getattribute__(self,name:str)->Any:returnsuper().__getattribute__(name)
[docs]classSample:"""Representation of sample that is sufficient for the blocks in this module. Each sample must have the following attributes: * attribute ``data``: Contains the data for this sample Parameters ---------- data : object Object representing the data to initialize this sample with. parent : object A parent object from which to inherit all other attributes (except ``data``) """def__init__(self,data,parent=None,**kwargs):self.data=dataifparentisnotNone:_copy_attributes(self,parent.__dict__)_copy_attributes(self,kwargs)def__setattr__(self,name:str,value:Any)->None:returnsuper().__setattr__(name,value)def__getattribute__(self,name:str)->Any:returnsuper().__getattribute__(name)