Skip to content

Commit

Permalink
make everyone happier
Browse files Browse the repository at this point in the history
  • Loading branch information
jaypantone committed Jan 15, 2025
1 parent c0515c7 commit 3c82533
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion comb_spec_searcher/comb_spec_searcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,12 @@ def _expand_classes_for(
comb_class = self.classdb.get_class(label)
last_label = label
if self.expand_verified or not self.ruledb.is_verified(label):
self._expand(comb_class, label, strategies, inferral) # type: ignore
self._expand(
comb_class, # pylint: disable=possibly-used-before-assignment
label,
strategies,
inferral,
)
if time.time() - expansion_start > expansion_time:
break
if status_update is not None and time.time() - status_start > status_update:
Expand Down
3 changes: 2 additions & 1 deletion comb_spec_searcher/tree_searcher.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Finds and returns a combinatorial specification, that we call a proof tree.
"""

import time
from collections import defaultdict, deque
from copy import deepcopy
Expand Down Expand Up @@ -205,7 +206,7 @@ def _bfs_helper(root_label: int, seen: FrozenSet[int]):
*[_bfs_helper(child_label, next_seen) for child_label in rule]
):
root_node = Node(root_label)
root_node.children = children
root_node.children = list(children)
yield root_node

sorted_rules_dict = {
Expand Down
3 changes: 2 additions & 1 deletion example.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
>>> specification.count_objects_of_size(n=15)
9798
"""

from itertools import product
from typing import Iterable, Iterator, Optional, Tuple, Union

Expand Down Expand Up @@ -148,7 +149,7 @@ def is_atom(self) -> bool:
def minimum_size_of_object(self) -> int:
return len(self.prefix)

def objects_of_size(self, size):
def objects_of_size(self, size) -> Iterator[Word]:
"""Yield the words of given size that start with prefix and avoid the
patterns. If just_prefix, then only yield that word."""

Expand Down

0 comments on commit 3c82533

Please sign in to comment.