Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ”¨ Replace @abstractproperty since it is deprecated #1964

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/anomalib/models/components/base/anomaly_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import importlib
import logging
from abc import ABC, abstractproperty
from abc import ABC, abstractmethod
from collections import OrderedDict
from typing import TYPE_CHECKING, Any

Expand Down Expand Up @@ -136,7 +136,8 @@ def test_step(self, batch: dict[str, str | torch.Tensor], batch_idx: int, *args,

return self.predict_step(batch, batch_idx)

@abstractproperty
@property
@abstractmethod
def trainer_arguments(self) -> dict[str, Any]:
"""Arguments used to override the trainer parameters so as to train the model correctly."""
raise NotImplementedError
Expand Down Expand Up @@ -203,7 +204,8 @@ def _get_instance(self, state_dict: OrderedDict[str, Any], dict_key: str) -> Bas
module = importlib.import_module(".".join(class_path.split(".")[:-1]))
return getattr(module, class_path.split(".")[-1])()

@abstractproperty
@property
@abstractmethod
def learning_type(self) -> LearningType:
"""Learning type of the model."""
raise NotImplementedError
Expand Down
Loading