From e94c9f66ae1912282d8629d26bf599c8429fbabc Mon Sep 17 00:00:00 2001 From: RollerKnobster Date: Mon, 8 Jul 2024 14:38:44 +0300 Subject: [PATCH] Formatting --- gordo/machine/model/anomaly/diff.py | 36 ++++++++++++++--------------- gordo/serializer/from_definition.py | 6 ++--- gordo/util/version.py | 3 +-- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/gordo/machine/model/anomaly/diff.py b/gordo/machine/model/anomaly/diff.py index 051610d21..e3b1f6f5d 100644 --- a/gordo/machine/model/anomaly/diff.py +++ b/gordo/machine/model/anomaly/diff.py @@ -95,13 +95,13 @@ def get_metadata(self): if hasattr(self, "aggregate_threshold_"): metadata["aggregate-threshold"] = self.aggregate_threshold_ if hasattr(self, "feature_thresholds_per_fold_"): - metadata[ - "feature-thresholds-per-fold" - ] = self.feature_thresholds_per_fold_.to_dict() + metadata["feature-thresholds-per-fold"] = ( + self.feature_thresholds_per_fold_.to_dict() + ) if hasattr(self, "aggregate_thresholds_per_fold_"): - metadata[ - "aggregate-thresholds-per-fold" - ] = self.aggregate_thresholds_per_fold_ + metadata["aggregate-thresholds-per-fold"] = ( + self.aggregate_thresholds_per_fold_ + ) # Window threshold metadata if hasattr(self, "window"): metadata["window"] = self.window @@ -111,9 +111,9 @@ def get_metadata(self): hasattr(self, "smooth_feature_thresholds_") and self.smooth_aggregate_threshold_ is not None ): - metadata[ - "smooth-feature-thresholds" - ] = self.smooth_feature_thresholds_.tolist() + metadata["smooth-feature-thresholds"] = ( + self.smooth_feature_thresholds_.tolist() + ) if ( hasattr(self, "smooth_aggregate_threshold_") and self.smooth_aggregate_threshold_ is not None @@ -121,13 +121,13 @@ def get_metadata(self): metadata["smooth-aggregate-threshold"] = self.smooth_aggregate_threshold_ if hasattr(self, "smooth_feature_thresholds_per_fold_"): - metadata[ - "smooth-feature-thresholds-per-fold" - ] = self.smooth_feature_thresholds_per_fold_.to_dict() + metadata["smooth-feature-thresholds-per-fold"] = ( + self.smooth_feature_thresholds_per_fold_.to_dict() + ) if hasattr(self, "smooth_aggregate_thresholds_per_fold_"): - metadata[ - "smooth-aggregate-thresholds-per-fold" - ] = self.smooth_aggregate_thresholds_per_fold_ + metadata["smooth-aggregate-thresholds-per-fold"] = ( + self.smooth_aggregate_thresholds_per_fold_ + ) if isinstance(self.base_estimator, GordoBase): metadata.update(self.base_estimator.get_metadata()) @@ -241,9 +241,9 @@ def cross_validate( smooth_aggregate_threshold_fold = ( scaled_mse.rolling(self.window).min().max() ) - self.smooth_aggregate_thresholds_per_fold_[ - f"fold-{i}" - ] = smooth_aggregate_threshold_fold + self.smooth_aggregate_thresholds_per_fold_[f"fold-{i}"] = ( + smooth_aggregate_threshold_fold + ) smooth_tag_thresholds_fold = mae.rolling(self.window).min().max() smooth_tag_thresholds_fold.name = f"fold-{i}" diff --git a/gordo/serializer/from_definition.py b/gordo/serializer/from_definition.py index e12291c0a..9bff1b7fa 100644 --- a/gordo/serializer/from_definition.py +++ b/gordo/serializer/from_definition.py @@ -176,9 +176,9 @@ def _build_step( import_str = list(step.keys())[0] try: - StepClass: Union[ - None, FeatureUnion, Pipeline, BaseEstimator - ] = import_location(import_str) + StepClass: Union[None, FeatureUnion, Pipeline, BaseEstimator] = ( + import_location(import_str) + ) except (ImportError, ValueError): StepClass = None diff --git a/gordo/util/version.py b/gordo/util/version.py index a43d3a5dd..60b11157d 100644 --- a/gordo/util/version.py +++ b/gordo/util/version.py @@ -8,8 +8,7 @@ class Version(metaclass=ABCMeta): @abstractmethod - def get_version(self): - ... + def get_version(self): ... class Special(Enum):