diff --git a/misc/generate_random_prediction.py b/misc/generate_random_prediction.py index 3670fe9..080b9a8 100644 --- a/misc/generate_random_prediction.py +++ b/misc/generate_random_prediction.py @@ -5,8 +5,8 @@ from pathlib import Path from dotenv import load_dotenv from shared.datastore import Datastore -from shared.mongodb import connect_mongodb -from shared.mongodb.src.classes import VisualCommunication +from shared.docstore import connect_mongodb +from shared.docstore.src.classes import VisualCommunication from shared.utils import check_env, setup_logging from web_ui.src.main import NECESSARY_ENV_VAR_LIST diff --git a/misc/get_visual_communication.py b/misc/get_visual_communication.py index 9643a6c..2341957 100644 --- a/misc/get_visual_communication.py +++ b/misc/get_visual_communication.py @@ -5,7 +5,7 @@ from pathlib import Path from dotenv import load_dotenv from shared.datastore import Datastore -from shared.mongodb import connect_mongodb, get_visual_communication +from shared.docstore import connect_mongodb, get_visual_communication from shared.utils import check_env, setup_logging from web_ui.src.main import NECESSARY_ENV_VAR_LIST diff --git a/misc/image_download.py b/misc/image_download.py index cc8f28f..760560e 100644 --- a/misc/image_download.py +++ b/misc/image_download.py @@ -5,8 +5,8 @@ from pathlib import Path from dotenv import load_dotenv -from shared.mongodb import connect_mongodb -from shared.mongodb.classes import VisualCommunication +from shared.docstore import connect_mongodb +from shared.docstore.classes import VisualCommunication if __name__ == '__main__': # prepare env vars diff --git a/misc/image_upload.py b/misc/image_upload.py index 9db6652..9798c83 100644 --- a/misc/image_upload.py +++ b/misc/image_upload.py @@ -6,8 +6,8 @@ from dotenv import load_dotenv from pymongo.errors import DuplicateKeyError from shared.datastore import Datastore -from shared.mongodb import connect_mongodb -from shared.mongodb.src.classes import VisualCommunication +from shared.docstore import connect_mongodb +from shared.docstore.src.classes import VisualCommunication from shared.utils import check_env, setup_logging from web_ui.src.main import NECESSARY_ENV_VAR_LIST diff --git a/misc/image_upload_to_server.py b/misc/image_upload_to_server.py index 2333c27..8f401cb 100644 --- a/misc/image_upload_to_server.py +++ b/misc/image_upload_to_server.py @@ -6,8 +6,8 @@ from dotenv import load_dotenv from pymongo.errors import DuplicateKeyError from shared.datastore import Datastore -from shared.mongodb import connect_mongodb -from shared.mongodb.src.classes import VisualCommunication +from shared.docstore import connect_mongodb +from shared.docstore.src.classes import VisualCommunication from shared.utils import check_env, setup_logging from web_ui.src.main import NECESSARY_ENV_VAR_LIST diff --git a/misc/model_outputs_from_annotation.py b/misc/model_outputs_from_annotation.py index 1406b48..34d90e5 100644 --- a/misc/model_outputs_from_annotation.py +++ b/misc/model_outputs_from_annotation.py @@ -1,4 +1,4 @@ -from shared.mongodb.classes import ModelData +from shared.docstore.classes import ModelData if __name__ == '__main__': # instantiate data object diff --git a/misc/prediction_upload.py b/misc/prediction_upload.py index 2506fe7..e29cc74 100644 --- a/misc/prediction_upload.py +++ b/misc/prediction_upload.py @@ -5,8 +5,8 @@ from pathlib import Path from dotenv import load_dotenv from shared.datastore import Datastore -from shared.mongodb import connect_mongodb, upsert_prediction -from shared.mongodb.src.classes import VisualCommunication +from shared.docstore import connect_mongodb, upsert_prediction +from shared.docstore.src.classes import VisualCommunication from shared.utils import check_env, setup_logging from web_ui.src.main import NECESSARY_ENV_VAR_LIST diff --git a/misc/total_annotated.py b/misc/total_annotated.py index 66f6b04..a60bbd1 100644 --- a/misc/total_annotated.py +++ b/misc/total_annotated.py @@ -5,7 +5,7 @@ from pathlib import Path from dotenv import load_dotenv -from shared.mongodb import connect_mongodb, count_documents +from shared.docstore import connect_mongodb, count_documents if __name__ == '__main__': # prepare env vars diff --git a/misc/total_documents.py b/misc/total_documents.py index fa8b1c8..29c3750 100644 --- a/misc/total_documents.py +++ b/misc/total_documents.py @@ -5,7 +5,7 @@ from pathlib import Path from dotenv import load_dotenv -from shared.mongodb import connect_mongodb, count_documents +from shared.docstore import connect_mongodb, count_documents if __name__ == '__main__': # prepare env vars diff --git a/model/src/main.py b/model/src/main.py index 91d22c2..9b4cb3d 100644 --- a/model/src/main.py +++ b/model/src/main.py @@ -10,7 +10,7 @@ from tqdm import tqdm from utils import DEVICE, VCDADataset, load_model from shared.datastore import Datastore -from shared.mongodb.classes import ModelData +from shared.docstore.classes import ModelData from shared.utils import setup_logging if __name__ == '__main__': diff --git a/model/src/models/visual_communication.py b/model/src/models/visual_communication.py index 256203b..071d69f 100644 --- a/model/src/models/visual_communication.py +++ b/model/src/models/visual_communication.py @@ -4,7 +4,7 @@ from __future__ import annotations from torch import nn -from shared.mongodb.src.classes import ModelData +from shared.docstore.src.classes import ModelData from .angle import AngleTail from .contact import ContactTail diff --git a/other/transfer_images_mongo_minio.py b/other/transfer_images_mongo_minio.py index 8b8033c..482f5aa 100644 --- a/other/transfer_images_mongo_minio.py +++ b/other/transfer_images_mongo_minio.py @@ -10,8 +10,8 @@ from dotenv import load_dotenv from pymongo.collection import Collection from shared.datastore import Datastore -from shared.mongodb import connect_mongodb -from shared.mongodb.src.classes import VisualCommunication +from shared.docstore import connect_mongodb +from shared.docstore.src.classes import VisualCommunication from shared.utils import check_env, setup_logging from web_ui.src.main import NECESSARY_ENV_VAR_LIST diff --git a/pyproject.toml b/pyproject.toml index 314593d..ae87d37 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -119,7 +119,7 @@ module = "models.*" ignore_missing_imports = true [[tool.mypy.overrides]] -module = "shared.mongodb.*" +module = "shared.docstore.*" ignore_missing_imports = true [[tool.mypy.overrides]] diff --git a/shared/mongodb/__init__.py b/shared/docstore/__init__.py similarity index 100% rename from shared/mongodb/__init__.py rename to shared/docstore/__init__.py diff --git a/shared/mongodb/src/__init__.py b/shared/docstore/src/__init__.py similarity index 100% rename from shared/mongodb/src/__init__.py rename to shared/docstore/src/__init__.py diff --git a/shared/mongodb/src/classes/__init__.py b/shared/docstore/src/classes/__init__.py similarity index 100% rename from shared/mongodb/src/classes/__init__.py rename to shared/docstore/src/classes/__init__.py diff --git a/shared/mongodb/src/classes/angle.py b/shared/docstore/src/classes/angle.py similarity index 100% rename from shared/mongodb/src/classes/angle.py rename to shared/docstore/src/classes/angle.py diff --git a/shared/mongodb/src/classes/contact.py b/shared/docstore/src/classes/contact.py similarity index 100% rename from shared/mongodb/src/classes/contact.py rename to shared/docstore/src/classes/contact.py diff --git a/shared/mongodb/src/classes/data_model.py b/shared/docstore/src/classes/data_model.py similarity index 100% rename from shared/mongodb/src/classes/data_model.py rename to shared/docstore/src/classes/data_model.py diff --git a/shared/mongodb/src/classes/distance.py b/shared/docstore/src/classes/distance.py similarity index 100% rename from shared/mongodb/src/classes/distance.py rename to shared/docstore/src/classes/distance.py diff --git a/shared/mongodb/src/classes/framing.py b/shared/docstore/src/classes/framing.py similarity index 100% rename from shared/mongodb/src/classes/framing.py rename to shared/docstore/src/classes/framing.py diff --git a/shared/mongodb/src/classes/information_value.py b/shared/docstore/src/classes/information_value.py similarity index 100% rename from shared/mongodb/src/classes/information_value.py rename to shared/docstore/src/classes/information_value.py diff --git a/shared/mongodb/src/classes/modality_color.py b/shared/docstore/src/classes/modality_color.py similarity index 100% rename from shared/mongodb/src/classes/modality_color.py rename to shared/docstore/src/classes/modality_color.py diff --git a/shared/mongodb/src/classes/modality_depth.py b/shared/docstore/src/classes/modality_depth.py similarity index 100% rename from shared/mongodb/src/classes/modality_depth.py rename to shared/docstore/src/classes/modality_depth.py diff --git a/shared/mongodb/src/classes/modality_lighting.py b/shared/docstore/src/classes/modality_lighting.py similarity index 100% rename from shared/mongodb/src/classes/modality_lighting.py rename to shared/docstore/src/classes/modality_lighting.py diff --git a/shared/mongodb/src/classes/model_data.py b/shared/docstore/src/classes/model_data.py similarity index 100% rename from shared/mongodb/src/classes/model_data.py rename to shared/docstore/src/classes/model_data.py diff --git a/shared/mongodb/src/classes/point_of_view.py b/shared/docstore/src/classes/point_of_view.py similarity index 100% rename from shared/mongodb/src/classes/point_of_view.py rename to shared/docstore/src/classes/point_of_view.py diff --git a/shared/mongodb/src/classes/salience.py b/shared/docstore/src/classes/salience.py similarity index 100% rename from shared/mongodb/src/classes/salience.py rename to shared/docstore/src/classes/salience.py diff --git a/shared/mongodb/src/classes/visual_communication.py b/shared/docstore/src/classes/visual_communication.py similarity index 98% rename from shared/mongodb/src/classes/visual_communication.py rename to shared/docstore/src/classes/visual_communication.py index 2291e6b..e39afc2 100755 --- a/shared/mongodb/src/classes/visual_communication.py +++ b/shared/docstore/src/classes/visual_communication.py @@ -13,7 +13,7 @@ from pydantic import BaseModel, ConfigDict from pymongo.collection import Collection from shared.datastore import Datastore -from shared.mongodb.src.classes import ModelData +from shared.docstore.src.classes import ModelData class VisualCommunication(BaseModel): diff --git a/shared/mongodb/src/classes/visual_syntax.py b/shared/docstore/src/classes/visual_syntax.py similarity index 100% rename from shared/mongodb/src/classes/visual_syntax.py rename to shared/docstore/src/classes/visual_syntax.py diff --git a/shared/mongodb/src/connect_mongodb.py b/shared/docstore/src/connect_mongodb.py similarity index 100% rename from shared/mongodb/src/connect_mongodb.py rename to shared/docstore/src/connect_mongodb.py diff --git a/shared/mongodb/src/count_documents.py b/shared/docstore/src/count_documents.py similarity index 100% rename from shared/mongodb/src/count_documents.py rename to shared/docstore/src/count_documents.py diff --git a/shared/docstore/src/docstore_interface.py b/shared/docstore/src/docstore_interface.py new file mode 100644 index 0000000..e69de29 diff --git a/shared/mongodb/src/exceptions/__init__.py b/shared/docstore/src/exceptions/__init__.py similarity index 100% rename from shared/mongodb/src/exceptions/__init__.py rename to shared/docstore/src/exceptions/__init__.py diff --git a/shared/mongodb/src/exceptions/no_document_found.py b/shared/docstore/src/exceptions/no_document_found.py similarity index 100% rename from shared/mongodb/src/exceptions/no_document_found.py rename to shared/docstore/src/exceptions/no_document_found.py diff --git a/shared/mongodb/src/get_dataset.py b/shared/docstore/src/get_dataset.py similarity index 100% rename from shared/mongodb/src/get_dataset.py rename to shared/docstore/src/get_dataset.py diff --git a/shared/mongodb/src/get_visual_communication.py b/shared/docstore/src/get_visual_communication.py similarity index 88% rename from shared/mongodb/src/get_visual_communication.py rename to shared/docstore/src/get_visual_communication.py index 57a4071..5c85a88 100755 --- a/shared/mongodb/src/get_visual_communication.py +++ b/shared/docstore/src/get_visual_communication.py @@ -6,8 +6,8 @@ import logging from pymongo.collection import Collection -from shared.mongodb.src.classes import VisualCommunication -from shared.mongodb.src.exceptions import NoDocumentFoundException +from shared.docstore.src.classes import VisualCommunication +from shared.docstore.src.exceptions import NoDocumentFoundException def get_visual_communication( diff --git a/shared/mongodb/src/list_names.py b/shared/docstore/src/list_names.py similarity index 100% rename from shared/mongodb/src/list_names.py rename to shared/docstore/src/list_names.py diff --git a/shared/mongodb/src/upsert_annotation.py b/shared/docstore/src/upsert_annotation.py similarity index 92% rename from shared/mongodb/src/upsert_annotation.py rename to shared/docstore/src/upsert_annotation.py index d7c8c4d..4eec4c0 100755 --- a/shared/mongodb/src/upsert_annotation.py +++ b/shared/docstore/src/upsert_annotation.py @@ -4,7 +4,7 @@ import logging from pymongo.collection import Collection -from shared.mongodb.src.classes import ModelData +from shared.docstore.src.classes import ModelData def upsert_annotation( diff --git a/shared/mongodb/src/upsert_prediction.py b/shared/docstore/src/upsert_prediction.py similarity index 92% rename from shared/mongodb/src/upsert_prediction.py rename to shared/docstore/src/upsert_prediction.py index 7f1ca8f..81378a8 100755 --- a/shared/mongodb/src/upsert_prediction.py +++ b/shared/docstore/src/upsert_prediction.py @@ -4,7 +4,7 @@ import logging from pymongo.collection import Collection -from shared.mongodb.src.classes import ModelData +from shared.docstore.src.classes import ModelData def upsert_prediction( diff --git a/shared/mongodb/src/upsert_visual_communication.py b/shared/docstore/src/upsert_visual_communication.py similarity index 88% rename from shared/mongodb/src/upsert_visual_communication.py rename to shared/docstore/src/upsert_visual_communication.py index 8ea39af..b5a863c 100755 --- a/shared/mongodb/src/upsert_visual_communication.py +++ b/shared/docstore/src/upsert_visual_communication.py @@ -2,7 +2,7 @@ from __future__ import annotations from pymongo.collection import Collection -from shared.mongodb.src.classes import VisualCommunication +from shared.docstore.src.classes import VisualCommunication def upsert_visual_communication( diff --git a/web_ui/src/app/init_app.py b/web_ui/src/app/init_app.py index e479e74..ce2ade3 100644 --- a/web_ui/src/app/init_app.py +++ b/web_ui/src/app/init_app.py @@ -12,9 +12,9 @@ from pydantic import ValidationError from pymongo.collection import Collection from shared.datastore import Datastore -from shared.mongodb import count_documents, get_visual_communication, upsert_annotation -from shared.mongodb.src.classes import ModelData, VisualCommunication -from shared.mongodb.src.exceptions import NoDocumentFoundException +from shared.docstore import count_documents, get_visual_communication, upsert_annotation +from shared.docstore.src.classes import ModelData, VisualCommunication +from shared.docstore.src.exceptions import NoDocumentFoundException from .layout import app_layout diff --git a/web_ui/src/app/layout/labels.py b/web_ui/src/app/layout/labels.py index a4ec822..7021829 100644 --- a/web_ui/src/app/layout/labels.py +++ b/web_ui/src/app/layout/labels.py @@ -3,7 +3,7 @@ from __future__ import annotations import dash_mantine_components as dmc from dash import dcc, html -from shared.mongodb.classes import ( +from shared.docstore.classes import ( AngleData, ContactData, DistanceData, diff --git a/web_ui/src/main.py b/web_ui/src/main.py index 5546b47..88a1d09 100644 --- a/web_ui/src/main.py +++ b/web_ui/src/main.py @@ -5,7 +5,7 @@ from __future__ import annotations import os from shared.datastore import Datastore -from shared.mongodb import connect_mongodb +from shared.docstore import connect_mongodb from shared.utils import check_env, setup_logging from .app import init_app