1234567891011121314151617181920212223242526272829 |
- '''
- This file is used for filter. Each filter contains different Options. And should be used for different format types.
- If you don't find a fitting filter then program it in this file to structure your coding.
- If there is a similar Filter which does not perfectly fit into your code, please extend this Filter instead of creating a new one
- Another Note: Try to keep up with this format: so with a lot of "coding Notes", the Class system and the variable_names
- If you have to use non-class filter please describe why and when to use this non-class filter
- '''
- from typing import Union
- import datetime
- import numpy as np
- class ManualTimeFilter:
- '''
- This filter, takes a Key(axe) which maps on Values on a Matrix
- takes an Matrix in which Values are filtered
- takes a timeconstraint
- Example: Key= Johann, Matrix= Arbeitszeitmatrix , timeconstraint= Monday
- Result: Filtered Version of this Matrix
- '''
- def __init__(self, key: str, matrix: Union[np.array, list], timeconstraint: Union[str, datetime]):
- self.key= key
- self.matrix = matrix
- self.timeconstraint = timeconstraint
- def __call__(self):
- return self.matrix
|