Coverage for source/environment/simple_label_annotator.py: 40%

15 statements  

« prev     ^ index     » next       coverage.py v7.8.0, created at 2025-06-06 12:00 +0000

1# agent/simple_label_annotator.py 

2 

3# global imports 

4import pandas as pd 

5from types import SimpleNamespace 

6 

7# local imports 

8from source.environment import LabelAnnotatorBase 

9 

10class SimpleLabelAnnotator(LabelAnnotatorBase): 

11 """""" 

12 

13 def __init__(self) -> None: 

14 """""" 

15 

16 super().__init__() 

17 self._output_classes.UP_TREND = 0 

18 self._output_classes.DOWN_TREND = 1 

19 self._output_classes.NO_TREND = 2 

20 

21 def _classify_trend(self, price_diff: float) -> int: 

22 """""" 

23 

24 if price_diff > 0.01: 

25 return self._output_classes.UP_TREND 

26 elif price_diff < -0.01: 

27 return self._output_classes.DOWN_TREND 

28 else: 

29 return self._output_classes.NO_TREND