diff --git a/chromadol/base.py b/chromadol/base.py index 7684689..ecdb37c 100644 --- a/chromadol/base.py +++ b/chromadol/base.py @@ -94,9 +94,7 @@ def clear(self): ... del chroma_client_instance[k] """ - raise NotImplementedError("Disabled for safety reasons.") - - + raise NotImplementedError('Disabled for safety reasons.') def int_string(x): diff --git a/chromadol/tests/__init__.py b/chromadol/tests/__init__.py index ad5e12d..e6a821a 100644 --- a/chromadol/tests/__init__.py +++ b/chromadol/tests/__init__.py @@ -1 +1 @@ -"""chromadol tests.""" \ No newline at end of file +"""chromadol tests.""" diff --git a/chromadol/tests/base_test.py b/chromadol/tests/base_test.py index 2414a54..cf3b765 100644 --- a/chromadol/tests/base_test.py +++ b/chromadol/tests/base_test.py @@ -7,10 +7,10 @@ def test_simple(): """A simple test of the ChromaClient and ChromaCollection classes.""" - - import tempfile, os + import tempfile, os + with tempfile.TemporaryDirectory() as temp_dir: - tempdir = os.path.join(temp_dir, "chromadol_test") + tempdir = os.path.join(temp_dir, 'chromadol_test') os.makedirs(tempdir) client = ChromaClient(tempdir) @@ -39,19 +39,23 @@ def test_simple(): assert sorted(collection) == ['of', 'piece'] - assert collection['piece'] == {'ids': ['piece'], - 'embeddings': None, - 'metadatas': [{'author': 'me'}], - 'documents': ['contents for piece'], - 'uris': None, - 'data': None} + assert collection['piece'] == { + 'ids': ['piece'], + 'embeddings': None, + 'metadatas': [{'author': 'me'}], + 'documents': ['contents for piece'], + 'uris': None, + 'data': None, + } - assert collection['of'] == {'ids': ['of'], - 'embeddings': None, - 'metadatas': [{'author': 'you'}], - 'documents': ['contents for of'], - 'uris': None, - 'data': None} + assert collection['of'] == { + 'ids': ['of'], + 'embeddings': None, + 'metadatas': [{'author': 'you'}], + 'documents': ['contents for of'], + 'uris': None, + 'data': None, + } # You can also read multiple documents at once. # But note that the order of the documents is not guaranteed. @@ -59,7 +63,7 @@ def test_simple(): # But you can read or write one document at a time too. collection['cake'] = { - "documents": "contents for cake", + 'documents': 'contents for cake', } assert set(collection) == {'piece', 'of', 'cake'} assert collection['cake'] == { @@ -82,10 +86,9 @@ def test_simple(): 'data': None, } - # The `collection` instance is not only dict-like, but also list-like in the + # The `collection` instance is not only dict-like, but also list-like in the # sense that it has an `.append` and an `.extend` method. assert len(collection) == 3 collection.extend(['two documents', 'specified without keys']) assert len(collection) == 5 - diff --git a/setup.cfg b/setup.cfg index 9ca1014..2d42464 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,7 +2,7 @@ root_url = https://github.com/i2mint/ license = mit author = OtoSense -version = 0.0.1 +version = 0.1.0 description = Data Object Layer for ChromaDB description_file = README.md long_description = file:README.md