diff --git a/docs/api/docgen.py b/docs/api/docgen.py index effef38..560ac2d 100644 --- a/docs/api/docgen.py +++ b/docs/api/docgen.py @@ -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 diff --git a/docs/conf.py b/docs/conf.py index d1e1c43..73c46eb 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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 diff --git a/pyglove/core/tuning/sample.py b/pyglove/core/tuning/sample.py index 752f671..d8e80e0 100644 --- a/pyglove/core/tuning/sample.py +++ b/pyglove/core/tuning/sample.py @@ -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: diff --git a/pyglove/core/typing/json_schema.py b/pyglove/core/typing/json_schema.py index 1955c9f..34a6203 100644 --- a/pyglove/core/typing/json_schema.py +++ b/pyglove/core/typing/json_schema.py @@ -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: diff --git a/pyglove/core/typing/value_specs.py b/pyglove/core/typing/value_specs.py index 072110f..835af58 100644 --- a/pyglove/core/typing/value_specs.py +++ b/pyglove/core/typing/value_specs.py @@ -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), diff --git a/pyglove/dev/reloader.py b/pyglove/dev/reloader.py index 83ab203..0aeaf44 100644 --- a/pyglove/dev/reloader.py +++ b/pyglove/dev/reloader.py @@ -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 diff --git a/pyglove/ext/evolution/recombinators.py b/pyglove/ext/evolution/recombinators.py index 01e34c4..5e0160d 100644 --- a/pyglove/ext/evolution/recombinators.py +++ b/pyglove/ext/evolution/recombinators.py @@ -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]