updated and added tests

This commit is contained in:
Brian Bjarke Jensen
2024-02-23 23:29:59 +01:00
parent cac816606a
commit 2ff699856c
4 changed files with 62 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
from pathlib import Path
from dotenv import load_dotenv
import os
from src.database import (
connect,
get_visual_communication
)
if __name__ == "__main__":
# prepare env vars
env_path = Path(__file__).parent.parent / "local.env"
assert env_path.exists()
load_dotenv(env_path)
os.environ["MONGO_HOST"] = "localhost"
# connect to database
collection, db, client = connect()
print(client.server_info())
# get visual communication
vis_com = get_visual_communication(collection)
print(vis_com.image)
+1
View File
@@ -23,3 +23,4 @@ if __name__ == "__main__":
print(repr(vis_com)) print(repr(vis_com))
if data is not None: if data is not None:
print(vis_com.image) print(vis_com.image)
print(vis_com.model_dump())
+20
View File
@@ -0,0 +1,20 @@
from pathlib import Path
from dotenv import load_dotenv
import os
from src.database import (
connect,
total_annotated
)
if __name__ == "__main__":
# prepare env vars
env_path = Path(__file__).parent.parent / "local.env"
assert env_path.exists()
load_dotenv(env_path)
os.environ["MONGO_HOST"] = "localhost"
# connect to database
collection, db, client = connect()
# get visual communication
num_docs = total_annotated(collection)
print(f"number of annotated documents in database: {num_docs}")
+20
View File
@@ -0,0 +1,20 @@
from pathlib import Path
from dotenv import load_dotenv
import os
from src.database import (
connect,
total_documents
)
if __name__ == "__main__":
# prepare env vars
env_path = Path(__file__).parent.parent / "local.env"
assert env_path.exists()
load_dotenv(env_path)
os.environ["MONGO_HOST"] = "localhost"
# connect to database
collection, db, client = connect()
# get visual communication
num_docs = total_documents(collection)
print(f"total number of documents in database: {num_docs}")