Move pytest configuration into pyproject.toml (#2141)

* Move pytest configuration into pyproject.toml

* Fix markers format

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Sara Zan 2022-02-08 17:23:59 +01:00 committed by GitHub
parent 692cde11e7
commit ffbba90323
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 47 additions and 15 deletions

View File

@ -1150,6 +1150,36 @@ def get_documents_by_id(ids: List[str], index: Optional[str] = None) -> List[Doc
Fetch documents by specifying a list of text id strings.
<a id="memory.InMemoryDocumentStore.get_scores_torch"></a>
#### get\_scores\_torch
```python
def get_scores_torch(query_emb: np.ndarray, document_to_search: List[Document]) -> List[float]
```
Calculate similarity scores between query embedding and a list of documents using torch.
**Arguments**:
- `query_emb`: Embedding of the query (e.g. gathered from DPR)
- `document_to_search`: List of documents to compare `query_emb` against.
<a id="memory.InMemoryDocumentStore.get_scores_numpy"></a>
#### get\_scores\_numpy
```python
def get_scores_numpy(query_emb: np.ndarray, document_to_search: List[Document]) -> List[float]
```
Calculate similarity scores between query embedding and a list of documents using numpy.
**Arguments**:
- `query_emb`: Embedding of the query (e.g. gathered from DPR)
- `document_to_search`: List of documents to compare `query_emb` against.
<a id="memory.InMemoryDocumentStore.query_by_embedding"></a>
#### query\_by\_embedding

View File

@ -22,9 +22,23 @@ disable = [
"too-few-public-methods",
"raise-missing-from"
]
[tool.pylint.'DESIGN']
max-args=7
[tool.pylint.'SIMILARITIES']
min-similarity-lines=6
min-similarity-lines=6
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--strict-markers"
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"tika: marks tests which require tika container (deselect with '-m \"not tika\"')",
"elasticsearch: marks tests which require elasticsearch container (deselect with '-m \"not elasticsearch\"')",
"graphdb: marks tests which require graphdb container (deselect with '-m \"not graphdb\"')",
"generator: marks generator tests (deselect with '-m \"not generator\"')",
"pipeline: marks tests with pipeline",
"summarizer: marks summarizer tests",
"weaviate: marks tests that require weaviate container",
"embedding_dim: marks usage of document store with non-default embedding dimension (e.g @pytest.mark.embedding_dim(128))",
]

View File

@ -1,12 +0,0 @@
[pytest]
addopts = --strict-markers
markers =
slow: marks tests as slow (deselect with '-m "not slow"')
tika: marks tests which require tika container (deselect with '-m "not tika"')
elasticsearch: marks tests which require elasticsearch container (deselect with '-m "not elasticsearch"')
graphdb: marks tests which require graphdb container (deselect with '-m "not graphdb"')
generator: marks generator tests (deselect with '-m "not generator"')
pipeline: marks tests with pipeline
summarizer: marks summarizer tests
weaviate: marks tests that require weaviate container
embedding_dim: marks usage of document store with non-default embedding dimension (e.g @pytest.mark.embedding_dim(128))