Skip to content

Commit

Permalink
Fix has_split method
Browse files Browse the repository at this point in the history
  • Loading branch information
Coloquinte committed Sep 17, 2022
1 parent 9b5d063 commit 44ddac1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name="torchsr",
version="1.0.3",
version="1.0.4",
description="Super Resolution Networks for pytorch",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
4 changes: 2 additions & 2 deletions torchsr/datasets/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ def get_splits(cls):
return set(sp for (t, sp, sc) in cls.track_dirs.keys())

@classmethod
def has_split(self, split):
def has_split(cls, split):
return split in cls.get_splits()

def get_dir(self, track, split, scale):
if (track, split, scale) not in self.track_dirs:
if track not in self.get_tracks():
raise ValueError(f"{self.__class__.__name__} does not include track {track}. "
f"Use one of {list(self.get_tracks())}")
if split not in self.get_splits():
if not self.has_split(split):
raise ValueError(f"{self.__class__.__name__} does not include split {split}. "
f"Use one of {list(self.get_splits())}")
available = ", ".join([str(sc) for t, sp, sc in self.track_dirs if t == track and sp == split])
Expand Down

0 comments on commit 44ddac1

Please sign in to comment.