Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
2a15b1c
docs: add contributing md
JohannesMessner Feb 7, 2023
dc6fdb1
Merge remote-tracking branch 'origin/feat-rewrite-v2' into feat-rewri…
JohannesMessner Feb 8, 2023
a643c2e
feat: draft document store
JohannesMessner Jan 23, 2023
c21c94a
wip: initial implementation, incomplete
JohannesMessner Feb 10, 2023
9e51f70
feat: return documents on find
JohannesMessner Feb 10, 2023
5910578
feat: delitem
JohannesMessner Feb 13, 2023
ddd379e
feat: get tensor dim from tensor parametrization
JohannesMessner Feb 13, 2023
831d2ce
docs: add sqlite integration
JohannesMessner Feb 13, 2023
bfd2bb5
feat: store hnsw indices
JohannesMessner Feb 13, 2023
d59eae8
reafctor: use universal id for sqlite and hnswlib
JohannesMessner Feb 14, 2023
df2e766
feat: implement num docs method
JohannesMessner Feb 14, 2023
fd051cd
feat: query builder
JohannesMessner Feb 16, 2023
7a9a7aa
chore: add lockfile
JohannesMessner Feb 16, 2023
cc81088
test: add tests for base doc store
JohannesMessner Feb 16, 2023
8cbabc2
test: add test for base query builder
JohannesMessner Feb 17, 2023
02b8670
refactor: settings management
JohannesMessner Feb 20, 2023
7aee239
refactor: query builder with decorator
JohannesMessner Feb 20, 2023
b5cd6e2
test: add one of those
JohannesMessner Feb 20, 2023
4fd9bc6
refactor: add structure and comments
JohannesMessner Feb 20, 2023
8cf8169
refactor: remove mem doc store
JohannesMessner Feb 20, 2023
a913054
refactor: remove useless code
JohannesMessner Feb 20, 2023
f1b05a1
feat: expose all hnswlib options
JohannesMessner Feb 20, 2023
f18026a
test: adjust tests
JohannesMessner Feb 20, 2023
aab20f8
docs: add comments
JohannesMessner Feb 21, 2023
ebbeed6
fix: sort docs when retrieving
JohannesMessner Feb 21, 2023
404ba2e
refactor: rename some vars
JohannesMessner Feb 22, 2023
f920c5f
test: delitem
JohannesMessner Feb 22, 2023
c28b309
test: test num docs
JohannesMessner Feb 22, 2023
9b8362b
test: test find
JohannesMessner Feb 23, 2023
451db41
refactor: pull more logic into the abstract class
JohannesMessner Feb 23, 2023
b83158f
refactor: improve abstraction of index
JohannesMessner Feb 23, 2023
f74ab5a
refactor: use helper to get field type
JohannesMessner Feb 27, 2023
b8a553a
refactor: change error message
JohannesMessner Feb 27, 2023
5c260e8
docs: add docstrings
JohannesMessner Feb 27, 2023
2b9ba37
fix: mypy
JohannesMessner Feb 27, 2023
1ae379c
docs: update docarray/storage/abstract_doc_store.py
JohannesMessner Feb 27, 2023
fcb289b
Merge remote-tracking branch 'origin/feat-rewrite-v2' into feat-rewri…
JohannesMessner Feb 27, 2023
ad32938
Merge branch 'feat-rewrite-v2' into feat-doc-store
JohannesMessner Feb 27, 2023
c7076f6
refactor: ruff
JohannesMessner Feb 27, 2023
f00f926
refactor: apply suggestion
JohannesMessner Feb 27, 2023
b8632de
fix: mypy bug
JohannesMessner Feb 28, 2023
992df0a
refactor: rename folders
JohannesMessner Feb 28, 2023
e2d099a
fix: handle type vars in class getitem
JohannesMessner Feb 28, 2023
f9727fa
refactor: rename directory
JohannesMessner Feb 28, 2023
61e7800
refactor: remove unused code
JohannesMessner Feb 28, 2023
c3734ce
fix: adjust imports to new dir name
JohannesMessner Feb 28, 2023
58ad417
docs: add guide for new doc stores
JohannesMessner Feb 28, 2023
89ac7d2
docs: update docs/tutorials/add_doc_index.md
JohannesMessner Mar 1, 2023
9b9ef00
docs: add doc store guidance to docs
JohannesMessner Mar 1, 2023
701d55e
docs: more precise wording
JohannesMessner Mar 1, 2023
37f0e6f
docs: more guidance
JohannesMessner Mar 1, 2023
421b388
refactor: remove kwargs stuff
JohannesMessner Mar 1, 2023
f31a050
docs: typo
JohannesMessner Mar 1, 2023
6855e51
refactor: add abstractions for get and del
JohannesMessner Mar 1, 2023
eb12fde
refactor: renaming
JohannesMessner Mar 1, 2023
8a02af1
Merge remote-tracking branch 'origin/feat-doc-store' into feat-doc-store
JohannesMessner Mar 1, 2023
c5bc8cf
test: add markers for slow and doc index
JohannesMessner Mar 1, 2023
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
15 changes: 2 additions & 13 deletions docarray/array/array/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from docarray.array.array.io import IOMixinArray
from docarray.base_document import AnyDocument, BaseDocument
from docarray.typing import NdArray
from docarray.utils.misc import is_torch_available
from docarray.utils.misc import is_np_int, is_torch_available

if TYPE_CHECKING:
from pydantic import BaseConfig
Expand Down Expand Up @@ -56,17 +56,6 @@ def _delegate_meth(self, *args, **kwargs):
return _delegate_meth


def _is_np_int(item: Any) -> bool:
dtype = getattr(item, 'dtype', None)
ndim = getattr(item, 'ndim', None)
if dtype is not None and ndim is not None:
try:
return ndim == 0 and np.issubdtype(dtype, np.integer)
except TypeError:
return False
return False # this is unreachable, but mypy wants it


class DocumentArray(IOMixinArray, AnyDocumentArray[T_doc]):
"""
DocumentArray is a container of Documents.
Expand Down Expand Up @@ -255,7 +244,7 @@ def _normalize_index_item(
return item

# numpy index types
if _is_np_int(item):
Comment thread
JohannesMessner marked this conversation as resolved.
if is_np_int(item):
return item.item()

index_has_getitem = hasattr(item, '__getitem__')
Expand Down
Empty file added docarray/doc_index/__init__.py
Empty file.
Loading