diff --git a/analytics/analytics/analytic_types/__init__.py b/analytics/analytics/analytic_types/__init__.py index 011f47c..205b50f 100644 --- a/analytics/analytics/analytic_types/__init__.py +++ b/analytics/analytics/analytic_types/__init__.py @@ -1,6 +1,6 @@ """ It is the place where we put all classes and types -which is common for all of the code. +common for all analytics code For example, if you write someting which is used in analytic_unit_manager, it should be here. @@ -8,11 +8,10 @@ in analytic_unit_manager, it should be here. If you create something spicific which is used only in one place, like PatternDetectionCache, then it should not be here. """ + import pandas as pd from typing import Union, List -from analytic_types.data_bucket import DataBucket - AnalyticUnitId = str diff --git a/analytics/analytics/analytic_types/data_bucket.py b/analytics/analytics/analytic_types/data_bucket.py index 0561872..5eb3809 100644 --- a/analytics/analytics/analytic_types/data_bucket.py +++ b/analytics/analytics/analytic_types/data_bucket.py @@ -1,9 +1,7 @@ import pandas as pd -class DataBucket(object): - - data: pd.DataFrame +class DataBucket: def __init__(self): self.data = pd.DataFrame([], columns=['timestamp', 'value']) diff --git a/analytics/analytics/detectors/pattern_detector.py b/analytics/analytics/detectors/pattern_detector.py index 23e565b..caaa053 100644 --- a/analytics/analytics/detectors/pattern_detector.py +++ b/analytics/analytics/detectors/pattern_detector.py @@ -8,7 +8,7 @@ import pandas as pd from typing import Optional, Generator, List from detectors import Detector -from analytic_types import DataBucket +from analytic_types.data_bucket import DataBucket from models import ModelCache from utils import convert_pd_timestamp_to_ms from analytic_types import AnalyticUnitId