GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — docarray/docarray/array/memory.py at docarray-v1-fixes · docarray/docarray

This repository was archived by the owner on Sep 9, 2026. It is now read-only.

Expand file tree

/

memory.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
35 lines (23 loc) · 1.06 KB
/

memory.py

Copy path

File metadata and controls

35 lines (23 loc) · 1.06 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from docarray.array.document import DocumentArray
from docarray.array.storage.memory import StorageMixins
class DocumentArrayInMemory(StorageMixins, DocumentArray):
"""
Default DocumentArray that stores Documents in memory.
With this implementation, :meth:`match` and :meth:`find` perform exact (exhaustive) vector search.
Example usage:
.. code-block:: python
from docarray import Document, DocumentArray
da = DocumentArray(
[Document(text='The cake is a lie'), Document(text='Do a barrel roll!')]
)
da.apply(Document.embed_feature_hashing)
query = Document(text='Can i have some cake?').embed_feature_hashing()
query.match(da, metric='jaccard', use_scipy=True)
print(query.matches[:, ('text', 'scores__jaccard__value')])
.. code-block:: bash
[['The cake is a lie', 'Do a barrel roll!'], [0.9, 1.0]]
.. seealso::
For further details, see our :ref:`user guide <documentarray>`.
"""
def __new__(cls, *args, **kwargs):
return super().__new__(cls)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.