fixed types
Code Quality Pipeline / Check Code (pull_request) Successful in 3m15s

This commit is contained in:
brian
2025-01-06 13:42:21 +00:00
parent 16ad2b80ee
commit aff0ae8fc6
16 changed files with 88 additions and 74 deletions
+6 -4
View File
@@ -5,9 +5,9 @@ from pathlib import Path
from dotenv import load_dotenv
from pymongo.errors import DuplicateKeyError
from shared.datastore import connect_minio
from shared.datastore import Datastore
from shared.mongodb import connect_mongodb
from shared.mongodb.classes import VisualCommunication
from shared.mongodb.src.classes import VisualCommunication
from shared.utils import check_env, setup_logging
from web_ui.src.main import NECESSARY_ENV_VAR_LIST
@@ -21,7 +21,9 @@ if __name__ == '__main__':
# setup logging
setup_logging()
# connect to minIO
minio_client = connect_minio()
datastore = Datastore()
datastore.connect()
assert datastore._client is not None
# connect to MongoDB
collection, db, client = connect_mongodb()
# get list of image paths
@@ -37,7 +39,7 @@ if __name__ == '__main__':
print(f"found {len(img_path_list)} images")
# create visual communication objects
vis_com_list = [
VisualCommunication.from_file(path, minio_client=minio_client)
VisualCommunication.from_file(path, minio_client=datastore._client)
for path in img_path_list
]
print(f"created {len(vis_com_list)} visual communication objects")