Add pydocstyle to the ruff rules (#52136)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <hej.mellor@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Harry Mellor
2026-09-16 16:44:29 +00:00
committed by GitHub
co-authored by Claude Opus 5
parent 804e5377aa
commit 8c1557a79c
2002 changed files with 15024 additions and 14269 deletions
+7 -8
View File
@@ -57,8 +57,7 @@ bytestr: TypeAlias = bytes | bytearray | memoryview | zmq.Frame
class OOBTensorConsumer(ABC):
@abstractmethod
def __call__(self, tensor: torch.Tensor) -> dict | None:
"""
Called with tensors for the current message.
"""Called with tensors for the current message.
Returns None to reject the tensor (falls back to regular serialization),
otherwise a dict with arbitrary placeholder data to be included
in the serialized message.
@@ -91,7 +90,8 @@ def _typestr(val: Any) -> tuple[str, str] | None:
def _encode_type_info_recursive(obj: Any) -> Any:
"""Recursively encode type information for nested structures of
lists/dicts."""
lists/dicts.
"""
if obj is None:
return None
if type(obj) is list:
@@ -105,7 +105,8 @@ def _decode_type_info_recursive(
type_info: Any, data: Any, convert_fn: Callable[[Sequence[str], Any], Any]
) -> Any:
"""Recursively decode type information for nested structures of
lists/dicts."""
lists/dicts.
"""
if type_info is None:
return data
if isinstance(type_info, dict):
@@ -489,8 +490,7 @@ def run_method(
args: tuple[Any, ...],
kwargs: dict[str, Any],
) -> Any:
"""
Run a method of an object with the given arguments and keyword arguments.
"""Run a method of an object with the given arguments and keyword arguments.
If the method is string, it will be converted to a method using getattr.
If the method is serialized bytes and will be deserialized using
cloudpickle.
@@ -528,8 +528,7 @@ class PydanticMsgspecMixin:
def __get_pydantic_core_schema__(
cls, source_type: Any, handler: GetCoreSchemaHandler
) -> core_schema.CoreSchema:
"""
Make msgspec.Struct compatible with Pydantic, respecting defaults.
"""Make msgspec.Struct compatible with Pydantic, respecting defaults.
Handle JSON=>msgspec.Struct. Used when exposing msgspec.Struct to the
API as input or in `/docs`. Note this is cached by Pydantic and not
called on every validation.