26 lines
570 B
Python
26 lines
570 B
Python
"""
|
|
Transform base for dataset records
|
|
"""
|
|
|
|
class Transform[I]:
|
|
"""
|
|
Dataset transform base class.
|
|
|
|
In places that directly reference a base ``Transform[I]``, a hint
|
|
``Callable[[I], I]`` would suffice. This class exists to allow nominal
|
|
checks for purpose-built transforms.
|
|
"""
|
|
|
|
def __call__(self, item: I) -> I:
|
|
"""
|
|
Apply transform to item.
|
|
|
|
Parameters:
|
|
item: item object to transform
|
|
|
|
Returns:
|
|
transformed item (same type ``I`` as input)
|
|
"""
|
|
|
|
raise NotImplementedError
|