Skip to content

Commit

Permalink
Package rename.
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrczarnas committed Oct 21, 2024
1 parent 80a16f5 commit b7f8567
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions home/lib/anomalies/anomaly_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from .data_types import RuleExecutionRunParameters, HistoricData

try:
import rules.dqopspaid.anomaly_detection
import rules.dqopspaid.ai.anomaly_detection
except ModuleNotFoundError:
ai_module_present = False
else:
Expand Down Expand Up @@ -85,7 +85,7 @@ def test_significance(values: list[float], parameters: RuleExecutionRunParameter
def detect_upper_bound_anomaly(historic_data: HistoricData, median: float, tail: float,
parameters: RuleExecutionRunParameters):
if hasattr(parameters.parameters, 'use_ai') and parameters.parameters.use_ai and ai_module_present:
return rules.dqopspaid.anomaly_detection.detect_upper_bound_anomaly(historic_data, median, tail, parameters)
return rules.dqopspaid.ai.anomaly_detection.detect_upper_bound_anomaly(historic_data, median, tail, parameters)

values = historic_data['converted_values']
values_above_median = [value for value in values if value is not None and value >= median]
Expand All @@ -107,7 +107,7 @@ def detect_upper_bound_anomaly(historic_data: HistoricData, median: float, tail:
def detect_lower_bound_anomaly(historic_data: HistoricData, median: float, tail: float,
parameters: RuleExecutionRunParameters):
if hasattr(parameters.parameters, 'use_ai') and parameters.parameters.use_ai and ai_module_present:
return rules.dqopspaid.anomaly_detection.detect_lower_bound_anomaly(historic_data, median, tail, parameters)
return rules.dqopspaid.ai.anomaly_detection.detect_lower_bound_anomaly(historic_data, median, tail, parameters)

values = historic_data['converted_values']
values_below_median = [value for value in values if value is not None and value <= median]
Expand Down

0 comments on commit b7f8567

Please sign in to comment.