Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
RollerKnobster committed Jul 8, 2024
1 parent ad19212 commit e94c9f6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 23 deletions.
36 changes: 18 additions & 18 deletions gordo/machine/model/anomaly/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -111,23 +111,23 @@ 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
):
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())
Expand Down Expand Up @@ -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}"
Expand Down
6 changes: 3 additions & 3 deletions gordo/serializer/from_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions gordo/util/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

class Version(metaclass=ABCMeta):
@abstractmethod
def get_version(self):
...
def get_version(self): ...


class Special(Enum):
Expand Down

0 comments on commit e94c9f6

Please sign in to comment.