Skip to content
Merged
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
4 changes: 2 additions & 2 deletions docarray/array/mixins/empty.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ class EmptyMixin:
"""Helper functions for building arrays with empty Document."""

@classmethod
def empty(cls: Type['T'], size: int = 0) -> 'T':
def empty(cls: Type['T'], size: int = 0, *args, **kwargs) -> 'T':
"""Create a :class:`DocumentArray` object with :attr:`size` empty
:class:`Document` objects.

:param size: the number of empty Documents in this container
:return: a :class:`DocumentArray` object
"""
return cls(Document() for _ in range(size))
return cls((Document() for _ in range(size)), *args, **kwargs)
5 changes: 4 additions & 1 deletion docarray/array/mixins/io/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ def from_bytes(
_show_progress: bool = False,
) -> 'T':
return cls.load_binary(
data, protocol=protocol, compress=compress, _show_progress=_show_progress
data,
protocol=protocol,
compress=compress,
_show_progress=_show_progress,
)

def save_binary(
Expand Down
2 changes: 2 additions & 0 deletions docarray/array/mixins/io/from_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def from_ndarray(
axis: int = 0,
size: Optional[int] = None,
shuffle: bool = False,
*args,
**kwargs,
) -> 'T':
"""Build from a numpy array.

Expand Down
6 changes: 1 addition & 5 deletions docarray/array/mixins/io/pushpull.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,7 @@ def read(self, n=-1):
)

@classmethod
def pull(
cls: Type['T'],
token: str,
show_progress: bool = False,
) -> 'T':
def pull(cls: Type['T'], token: str, show_progress: bool = False) -> 'T':
"""Pulling a :class:`DocumentArray` from Jina Cloud Service to local.

:param token: the upload token set during :meth:`.push`
Expand Down
5 changes: 1 addition & 4 deletions docarray/array/mixins/pydantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ def to_pydantic_model(self) -> 'PydanticDocumentArray':
return [d.to_pydantic_model() for d in self]

@classmethod
def from_pydantic_model(
cls: Type['T'],
model: List['BaseModel'],
) -> 'T':
def from_pydantic_model(cls: Type['T'], model: List['BaseModel']) -> 'T':
"""Convert a list of PydanticDocument into

:param model: the pydantic data model object that represents a DocumentArray
Expand Down