Skip to content

Commit

Permalink
pylint changes
Browse files Browse the repository at this point in the history
rh-pre-commit.version: 2.2.0
rh-pre-commit.check-secrets: ENABLED
  • Loading branch information
Auto User committed Sep 19, 2024
1 parent 9daf2f3 commit ff71b82
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
9 changes: 4 additions & 5 deletions pkg/algorithms/cmr/cmr.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def _analyze(self):
series: data series that contains attributes and full dataframe
change_points_by_metric: list of ChangePoints
"""
self.logger_instance = SingletonLogger.getLogger("Orion")
self.logger_instance.info("Starting analysis using CMR")
logger_instance = SingletonLogger.getLogger("Orion")
logger_instance.info("Starting analysis using CMR")
self.dataframe["timestamp"] = pd.to_datetime(self.dataframe["timestamp"])
self.dataframe["timestamp"] = self.dataframe["timestamp"].astype(int) // 10**9

Expand All @@ -39,14 +39,13 @@ def _analyze(self):
self.dataframe = self.combine_and_average_runs( self.dataframe)

series= self.setup_series()
tolerancy = 20

df, change_points_by_metric = self.run_cmr(tolerancy, self.dataframe)
df, change_points_by_metric = self.run_cmr(self.dataframe)
series.data= df
return series, change_points_by_metric


def run_cmr(self, tolerancy: int, dataframe_list: pd.DataFrame):
def run_cmr(self, dataframe_list: pd.DataFrame):
"""
Generate the percent difference in a 2 row dataframe
Expand Down
10 changes: 9 additions & 1 deletion pkg/runTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,21 @@
from pkg.utils import get_datasource, process_test, get_subtracted_timestamp

def get_algorithm_type(kwargs):
"""Switch Case of getting algorithm name
Args:
kwargs (dict): passed command line arguments
Returns:
str: algorithm name
"""
if kwargs["hunter_analyze"]:
algorithm_name = cnsts.EDIVISIVE
elif kwargs["anomaly_detection"]:
algorithm_name = cnsts.ISOLATION_FOREST
elif kwargs['cmr']:
algorithm_name = cnsts.CMR
else:
else:
algorithm_name = None
return algorithm_name

Expand Down

0 comments on commit ff71b82

Please sign in to comment.