Skip to content

Commit ee7eaaa

Browse files
authoredJun 23, 2024··
Remove mkdocs, cleanup Makefile, move test (#11)
* cleaned up a bit * various cleanup * move test
1 parent c593ad4 commit ee7eaaa

File tree

4 files changed

+8
-1771
lines changed

4 files changed

+8
-1771
lines changed
 

‎Makefile

+5-9
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,14 @@ build: ## Build wheel file using poetry
2424
@echo "🚀 Creating wheel file"
2525
@poetry build
2626

27-
.PHONY: docs-test
28-
docs-test: ## Test if documentation can be built without warnings or errors
29-
@poetry run mkdocs build -s
30-
31-
.PHONY: docs
32-
docs: ## Build and serve the documentation
33-
@poetry run mkdocs serve
34-
3527
.PHONY: serve
36-
serve: ## Serve API with uvicorn
28+
serve: ## Serve API with uvicorn in development mode
3729
@poetry run uvicorn pypi_scout.api.main:app --reload
3830

31+
.PHONY: frontend
32+
frontend: ## Serve frontend in development mode
33+
@cd frontend; npm run dev
34+
3935
.PHONY: help
4036
help:
4137
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'

‎poetry.lock

+2-1,750
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pyproject.toml

-6
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@ pytest-mock = "^3.14.0"
3535
deptry = "^0.12.0"
3636
pre-commit = "^3.4.0"
3737
tox = "^4.11.1"
38-
jupyterlab = "^4.2.2"
39-
40-
[tool.poetry.group.docs.dependencies]
41-
mkdocs = "^1.4.2"
42-
mkdocs-material = "^9.2.7"
43-
mkdocstrings = {extras = ["python"], version = "^0.23.0"}
4438

4539
[build-system]
4640
requires = ["poetry-core>=1.0.0"]

‎tests/test_vdb.py ‎tests/embeddings/test_simple_vector_database.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ def vector_db(mock_model, df_embeddings):
3333

3434

3535
def test_embeddings_matrix_creation(vector_db):
36-
expected_matrix = np.array(
37-
[[0.1, 0.2, 0.3], [0.4, 0.5, 0.6], [0.7, 0.8, 0.9]], dtype=np.float32
38-
) # Ensure the expected matrix has dtype float32
36+
expected_matrix = np.array([[0.1, 0.2, 0.3], [0.4, 0.5, 0.6], [0.7, 0.8, 0.9]], dtype=np.float32)
3937

4038
np.testing.assert_allclose(vector_db.embeddings_matrix, expected_matrix, rtol=1e-6, atol=1e-8)
4139

@@ -44,13 +42,10 @@ def test_find_similar(vector_db):
4442
query = "Hello"
4543
result = vector_db.find_similar(query, top_k=2)
4644

47-
# Check that the result has the expected number of rows
4845
assert result.shape[0] == 2
4946

50-
# Check that the similarity scores are between 0 and 1
5147
assert result["similarity"].min() >= 0
5248
assert result["similarity"].max() <= 1
5349

54-
# Check that the result contains the expected columns
5550
expected_columns = ["id", "text", "similarity"]
5651
assert set(result.columns) == set(expected_columns)

0 commit comments

Comments
 (0)
Please sign in to comment.