Coverage for source/indicators/indicator_handler_base.py: 75%
8 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-07-30 20:59 +0000
« prev ^ index » next coverage.py v7.8.0, created at 2025-07-30 20:59 +0000
1# indicators/indicator_handler_base.py
3# global imports
4import pandas as pd
5from abc import ABC, abstractmethod
7# local imports
9class IndicatorHandlerBase(ABC):
10 """
11 Base class for indicators. Enforces certain functions to be implemented
12 in derivative classes.
13 """
15 @abstractmethod
16 def calculate(self, data: pd.DataFrame) -> pd.DataFrame:
17 """
18 Calculates indicator values for given data.
20 Parameters:
21 data (pd.DataFrame): Data frame with input data.
23 Returns:
24 (pd.DataFrame): Output data with calculated values for certain indicator.
25 """
27 pass
29 def can_be_normalized(self) -> bool:
30 """
31 Checks if the indicator can be normalized.
33 Returns:
34 (bool): True if the indicator can be normalized, False otherwise.
35 """
37 return False