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

change get_available_data to class method #274

Merged
merged 1 commit into from
Jun 17, 2023
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
9 changes: 5 additions & 4 deletions dance/datasets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,11 @@ def _maybe_download(self):
logger.debug("Missing files ({self.is_complete()=!r}). Start downloading...")
self.download()

def get_avalilable_data(self) -> Union[List[str], Dict[str, List[Any]]]:
@classmethod
def get_avalilable_data(cls) -> Union[List[str], Dict[str, List[Any]]]:
"""List available data of the dataset."""
if hasattr(self, "AVAILABLE_DATA"):
return self.AVAILABLE_DATA
if hasattr(cls, "AVAILABLE_DATA"):
return cls.AVAILABLE_DATA
else:
raise NotImplementedError(f"Dataset {self.__class__.__name__} does not have AVAILABLE_DATA specified yet, "
raise NotImplementedError(f"Dataset {cls.__class__.__name__} does not have AVAILABLE_DATA specified yet, "
"please specify in the class definition to enable listing data availablity.")