Skip to content

Commit

Permalink
Correctly used properties and setters in ABC
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim-Encord committed Feb 29, 2024
1 parent a7ea8fc commit 8e6a332
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions clip_eval/dataset/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def __init__(
self.transform = transform
self.__title = title
self.__title_in_source = title if title_in_source is None else title_in_source
self.__class_names = []

@abstractmethod
def __getitem__(self, idx):
Expand All @@ -34,8 +35,12 @@ def title_in_source(self) -> str:
return self.__title_in_source

@property
def class_names(self) -> str:
return self.class_names
def class_names(self) -> list[str]:
return self.__class_names

@class_names.setter
def class_names(self, class_names: list[str]) -> None:
self.__class_names = class_names

def set_transform(self, transform):
self.transform = transform
Expand Down

0 comments on commit 8e6a332

Please sign in to comment.