Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added suppressions for type errors in various places. #326

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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 pyglove/core/geno/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def is_constant(self) -> bool:
"""
return not self.elements

def validate(self, dna: DNA) -> None:
def validate(self, dna: DNA) -> None: # pytype: disable=signature-mismatch
"""Validate whether a DNA value conforms to this spec."""
if not self.elements and (dna.value is not None or dna.children):
raise ValueError(
Expand Down
6 changes: 3 additions & 3 deletions pyglove/core/io/file_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def mkdirs(
def rm(self, path: Union[str, os.PathLike[str]]) -> None:
os.remove(path)

def rmdir(self, path: Union[str, os.PathLike[str]]) -> None:
def rmdir(self, path: Union[str, os.PathLike[str]]) -> None: # pytype: disable=signature-mismatch
os.rmdir(path)

def rmdirs(self, path: Union[str, os.PathLike[str]]) -> None:
Expand Down Expand Up @@ -336,7 +336,7 @@ def rm(self, path: Union[str, os.PathLike[str]]) -> None:
raise IsADirectoryError(path)
del parent_dir[name]

def rmdir(self, path: Union[str, os.PathLike[str]]) -> None:
def rmdir(self, path: Union[str, os.PathLike[str]]) -> None: # pytype: disable=signature-mismatch
parent_dir, name = self._parent_and_name(path)
entry = parent_dir.get(name)
if entry is None:
Expand Down Expand Up @@ -485,4 +485,4 @@ def rmdir(path: Union[str, os.PathLike[str]]) -> bool:

def rmdirs(path: Union[str, os.PathLike[str]]) -> bool:
"""Removes a directory chain until a parent directory is not empty."""
return _fs.get(path).rmdirs(path)
return _fs.get(path).rmdirs(path) # pytype: disable=bad-return-type
2 changes: 1 addition & 1 deletion pyglove/core/typing/class_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def __eq__(self, other: Any) -> bool:
elif isinstance(other, ForwardRef):
return self.module is other.module and self.name == other.name
elif inspect.isclass(other):
return self.resolved and self.cls is other
return self.resolved and self.cls is other # pytype: disable=bad-return-type

def __ne__(self, other: Any) -> bool:
"""Operator!=."""
Expand Down
Loading