arkindex-base-worker 0.5.0b3__py3-none-any.whl → 0.5.1b1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {arkindex_base_worker-0.5.0b3.dist-info → arkindex_base_worker-0.5.1b1.dist-info}/METADATA +3 -3
- {arkindex_base_worker-0.5.0b3.dist-info → arkindex_base_worker-0.5.1b1.dist-info}/RECORD +16 -17
- arkindex_worker/cache.py +3 -22
- arkindex_worker/worker/__init__.py +75 -6
- arkindex_worker/worker/element.py +9 -0
- arkindex_worker/worker/entity.py +17 -126
- arkindex_worker/worker/metadata.py +0 -11
- tests/conftest.py +33 -0
- tests/test_cache.py +1 -2
- tests/test_elements_worker/{test_entity_create.py → test_entity.py} +220 -227
- tests/test_elements_worker/test_metadata.py +0 -47
- tests/test_elements_worker/test_worker.py +94 -0
- tests/test_merge.py +0 -7
- tests/test_elements_worker/test_entity_list_and_check.py +0 -293
- {arkindex_base_worker-0.5.0b3.dist-info → arkindex_base_worker-0.5.1b1.dist-info}/WHEEL +0 -0
- {arkindex_base_worker-0.5.0b3.dist-info → arkindex_base_worker-0.5.1b1.dist-info}/licenses/LICENSE +0 -0
- {arkindex_base_worker-0.5.0b3.dist-info → arkindex_base_worker-0.5.1b1.dist-info}/top_level.txt +0 -0
tests/test_cache.py
CHANGED
|
@@ -60,9 +60,8 @@ def test_create_tables(tmp_path):
|
|
|
60
60
|
CREATE TABLE "dataset_elements" ("id" TEXT NOT NULL PRIMARY KEY, "element_id" TEXT NOT NULL, "dataset_id" TEXT NOT NULL, "set_name" VARCHAR(255) NOT NULL, FOREIGN KEY ("element_id") REFERENCES "elements" ("id"), FOREIGN KEY ("dataset_id") REFERENCES "datasets" ("id"))
|
|
61
61
|
CREATE TABLE "datasets" ("id" TEXT NOT NULL PRIMARY KEY, "name" VARCHAR(255) NOT NULL, "state" VARCHAR(255) NOT NULL DEFAULT 'open', "sets" TEXT NOT NULL)
|
|
62
62
|
CREATE TABLE "elements" ("id" TEXT NOT NULL PRIMARY KEY, "parent_id" TEXT, "type" VARCHAR(50) NOT NULL, "image_id" TEXT, "polygon" text, "rotation_angle" INTEGER NOT NULL, "mirrored" INTEGER NOT NULL, "initial" INTEGER NOT NULL, "worker_version_id" TEXT, "worker_run_id" TEXT, "confidence" REAL, FOREIGN KEY ("image_id") REFERENCES "images" ("id"))
|
|
63
|
-
CREATE TABLE "entities" ("id" TEXT NOT NULL PRIMARY KEY, "type" VARCHAR(50) NOT NULL, "name" TEXT NOT NULL, "validated" INTEGER NOT NULL, "metas" text, "worker_run_id" TEXT)
|
|
64
63
|
CREATE TABLE "images" ("id" TEXT NOT NULL PRIMARY KEY, "width" INTEGER NOT NULL, "height" INTEGER NOT NULL, "url" TEXT NOT NULL)
|
|
65
|
-
CREATE TABLE "transcription_entities" ("transcription_id" TEXT NOT NULL, "
|
|
64
|
+
CREATE TABLE "transcription_entities" ("transcription_id" TEXT NOT NULL, "type" VARCHAR(50) NOT NULL, "offset" INTEGER NOT NULL CHECK (offset >= 0), "length" INTEGER NOT NULL CHECK (length > 0), "worker_run_id" TEXT, "confidence" REAL, PRIMARY KEY ("transcription_id", "type"), FOREIGN KEY ("transcription_id") REFERENCES "transcriptions" ("id"))
|
|
66
65
|
CREATE TABLE "transcriptions" ("id" TEXT NOT NULL PRIMARY KEY, "element_id" TEXT NOT NULL, "text" TEXT NOT NULL, "confidence" REAL, "orientation" VARCHAR(50) NOT NULL, "worker_version_id" TEXT, "worker_run_id" TEXT, FOREIGN KEY ("element_id") REFERENCES "elements" ("id"))"""
|
|
67
66
|
|
|
68
67
|
actual_schema = "\n".join(
|