Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion docs/api/docgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def doc_dir(self) -> str:
return ''
if isinstance(self, Leaf):
dir_segments.pop(-1)
return os.path.join(self.source_category, *dir_segments)
return os.path.join(self.source_category, *dir_segments) # pyrefly: ignore[no-matching-overload]

@property
@abc.abstractmethod
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def get_git_location(module_name, entity_name):
except TypeError:
# e.g. target is constant number, etc.
return None
file = os.path.relpath(file, os.path.abspath('..'))
file = os.path.relpath(file, os.path.abspath('..')) # pyrefly: ignore[no-matching-overload]
if not file.startswith('pyglove'):
return None
start, end = lines[1], lines[1] + len(lines[0]) - 1
Expand Down
2 changes: 1 addition & 1 deletion pyglove/core/tuning/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def fun():

while True:
try:
feedback = backend.next()
feedback = backend.next() # pyrefly: ignore[missing-attribute]
dna = feedback.dna
reward = dna.metadata.get('reward')
if reward is None:
Expand Down
2 changes: 1 addition & 1 deletion pyglove/core/typing/json_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def _remove_type_name(_, v: Dict[str, Any]):
if not ignore_nonable and value_spec.is_noneable:
nullable = {'type': 'null'}
if 'anyOf' in definition:
definition['anyOf'].append(nullable)
definition['anyOf'].append(nullable) # pyrefly: ignore[missing-attribute]
else:
definition = {'anyOf': [definition, nullable]}
if value_spec.default is None:
Expand Down
2 changes: 1 addition & 1 deletion pyglove/core/typing/value_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2031,7 +2031,7 @@ def format(
if self._forward_ref is not None:
name = self._forward_ref.name
else:
name = self._value_type.__name__
name = self._value_type.__name__ # pyrefly: ignore[missing-attribute]
return utils.kvlist_str(
[
('', utils.RawText(name), None),
Expand Down
2 changes: 1 addition & 1 deletion pyglove/dev/reloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def _reload(m: types.ModuleType):
reloaded_modules = []
for m in modules:
if verbose:
print(f'Reloading [{m.__name__}]...')
print(f'Reloading [{m.__name__}]...') # pyrefly: ignore[missing-attribute]
reloaded_modules.append(_reload(m)) # pyrefly: ignore[bad-argument-type]

elapse = time.time() - start_time
Expand Down
4 changes: 2 additions & 2 deletions pyglove/ext/evolution/recombinators.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,14 +826,14 @@ def possible_permutation_points(
# subchoices of a multi-choice.
permutation_proposals: List[List[int]] = self.permutate(
permutation_point,
[[dna.value for dna in p[permutation_point]] for p in parent_dicts]) # pyrefly: ignore[not-iterable]
[[dna.value for dna in p[permutation_point]] for p in parent_dicts]) # pyrefly: ignore[missing-attribute, not-iterable]

# For each child proposal, merge it back with each parent's DNA to
# produce an output. Therefore if there are N parents and M permuation
# proposals, the maximum number of output is N * M. Duplicates will be
# removed so it may lead to a smaller number than N * M.
for parent_dict in parent_dicts:
subdna_map = {d.value: d for d in parent_dict[permutation_point]} # pyrefly: ignore[not-iterable]
subdna_map = {d.value: d for d in parent_dict[permutation_point]} # pyrefly: ignore[missing-attribute, not-iterable]
for proposal in permutation_proposals:
parent_dict[permutation_point] = [subdna_map[v] for v in proposal] # pyrefly: ignore[unsupported-operation]
outputs.append(pg.DNA.from_dict(parent_dict, dna_spec)) # pyrefly: ignore[bad-argument-type]
Expand Down
Loading