Skip to content

Commit

Permalink
remove unmodified dunder methods
Browse files Browse the repository at this point in the history
  • Loading branch information
zafstojano committed Feb 6, 2025
1 parent 071c22a commit b5a820a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 42 deletions.
14 changes: 0 additions & 14 deletions reasoning_gym/games/n_queens.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,6 @@ def __init__(self, config: NQueensConfig):
super().__init__(config=config, seed=config.seed, size=config.size)
self._solutions = self._get_all_solutions(config.n)

def __len__(self) -> int:
return self.config.size

def __iter__(self):
self._current_idx = 0
return self

def __next__(self):
if self._current_idx >= self.config.size:
raise StopIteration
item = self[self._current_idx]
self._current_idx += 1
return item

def _get_all_solutions(self, n: int) -> List[List[List[str]]]:
"""Get all solutions for the N Queens puzzle"""

Expand Down
14 changes: 0 additions & 14 deletions reasoning_gym/graphs/course_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,6 @@ class CourseScheduleDataset(ProceduralDataset):
def __init__(self, config: CourseScheduleConfig):
super().__init__(config=config, seed=config.seed, size=config.size)

def __len__(self) -> int:
return self.config.size

def __iter__(self):
self._current_idx = 0
return self

def __next__(self):
if self._current_idx >= self.config.size:
raise StopIteration
item = self[self._current_idx]
self._current_idx += 1
return item

def _can_finish(self, num_courses: int, prerequisites: List[List[int]]) -> bool:
adj = defaultdict(list)
for course, prereq in prerequisites:
Expand Down
14 changes: 0 additions & 14 deletions reasoning_gym/graphs/largest_island.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,6 @@ class LargestIslandDataset(ProceduralDataset):
def __init__(self, config: LargestIslandConfig):
super().__init__(config=config, seed=config.seed, size=config.size)

def __len__(self) -> int:
return self.config.size

def __iter__(self):
self._current_idx = 0
return self

def __next__(self):
if self._current_idx >= self.config.size:
raise StopIteration
item = self[self._current_idx]
self._current_idx += 1
return item

def _is_valid_cell(self, r: int, c: int) -> bool:
return 0 <= r < self.config.rows and 0 <= c < self.config.cols

Expand Down

0 comments on commit b5a820a

Please sign in to comment.