arkindex-base-worker 0.4.0__py3-none-any.whl → 0.4.0a2__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.
Files changed (51) hide show
  1. {arkindex_base_worker-0.4.0.dist-info → arkindex_base_worker-0.4.0a2.dist-info}/METADATA +13 -15
  2. arkindex_base_worker-0.4.0a2.dist-info/RECORD +51 -0
  3. {arkindex_base_worker-0.4.0.dist-info → arkindex_base_worker-0.4.0a2.dist-info}/WHEEL +1 -1
  4. arkindex_worker/cache.py +1 -1
  5. arkindex_worker/image.py +1 -120
  6. arkindex_worker/utils.py +0 -82
  7. arkindex_worker/worker/__init__.py +161 -46
  8. arkindex_worker/worker/base.py +11 -36
  9. arkindex_worker/worker/classification.py +18 -34
  10. arkindex_worker/worker/corpus.py +4 -21
  11. arkindex_worker/worker/dataset.py +1 -71
  12. arkindex_worker/worker/element.py +91 -352
  13. arkindex_worker/worker/entity.py +11 -11
  14. arkindex_worker/worker/metadata.py +9 -19
  15. arkindex_worker/worker/task.py +4 -5
  16. arkindex_worker/worker/training.py +6 -6
  17. arkindex_worker/worker/transcription.py +68 -89
  18. arkindex_worker/worker/version.py +1 -3
  19. tests/__init__.py +1 -1
  20. tests/conftest.py +45 -33
  21. tests/test_base_worker.py +3 -204
  22. tests/test_dataset_worker.py +4 -7
  23. tests/test_elements_worker/{test_classification.py → test_classifications.py} +61 -194
  24. tests/test_elements_worker/test_corpus.py +1 -32
  25. tests/test_elements_worker/test_dataset.py +1 -1
  26. tests/test_elements_worker/test_elements.py +2734 -0
  27. tests/test_elements_worker/{test_entity_create.py → test_entities.py} +160 -26
  28. tests/test_elements_worker/test_image.py +1 -2
  29. tests/test_elements_worker/test_metadata.py +99 -224
  30. tests/test_elements_worker/test_task.py +1 -1
  31. tests/test_elements_worker/test_training.py +2 -2
  32. tests/test_elements_worker/test_transcriptions.py +2102 -0
  33. tests/test_elements_worker/test_worker.py +280 -563
  34. tests/test_image.py +204 -429
  35. tests/test_merge.py +2 -1
  36. tests/test_utils.py +3 -66
  37. arkindex_base_worker-0.4.0.dist-info/RECORD +0 -61
  38. arkindex_worker/worker/process.py +0 -92
  39. tests/test_elements_worker/test_element.py +0 -427
  40. tests/test_elements_worker/test_element_create_multiple.py +0 -715
  41. tests/test_elements_worker/test_element_create_single.py +0 -528
  42. tests/test_elements_worker/test_element_list_children.py +0 -969
  43. tests/test_elements_worker/test_element_list_parents.py +0 -530
  44. tests/test_elements_worker/test_entity_list_and_check.py +0 -160
  45. tests/test_elements_worker/test_process.py +0 -89
  46. tests/test_elements_worker/test_transcription_create.py +0 -873
  47. tests/test_elements_worker/test_transcription_create_with_elements.py +0 -951
  48. tests/test_elements_worker/test_transcription_list.py +0 -450
  49. tests/test_elements_worker/test_version.py +0 -60
  50. {arkindex_base_worker-0.4.0.dist-info → arkindex_base_worker-0.4.0a2.dist-info}/LICENSE +0 -0
  51. {arkindex_base_worker-0.4.0.dist-info → arkindex_base_worker-0.4.0a2.dist-info}/top_level.txt +0 -0
@@ -1,89 +0,0 @@
1
- import pytest
2
-
3
- from tests import PROCESS_ID
4
-
5
-
6
- @pytest.mark.parametrize(
7
- ("with_image", "elements"),
8
- [
9
- (
10
- False,
11
- [
12
- {
13
- "id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
14
- "type_id": "baaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
15
- "name": "element 1",
16
- "confidence": 1,
17
- "image_id": None,
18
- "image_width": None,
19
- "image_height": None,
20
- "image_url": None,
21
- "polygon": None,
22
- "rotation_angle": 0,
23
- "mirrored": False,
24
- },
25
- {
26
- "id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa0",
27
- "type_id": "baaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
28
- "name": "element 2",
29
- "confidence": 1,
30
- "image_id": None,
31
- "image_width": None,
32
- "image_height": None,
33
- "image_url": None,
34
- "polygon": None,
35
- "rotation_angle": 0,
36
- "mirrored": False,
37
- },
38
- ],
39
- ),
40
- (
41
- True,
42
- [
43
- {
44
- "id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
45
- "type_id": "baaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
46
- "name": "element 1",
47
- "confidence": 1,
48
- "image_id": "aaa2aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
49
- "image_width": 76,
50
- "image_height": 138,
51
- "image_url": "http://somewhere.com/iiif/image.jpeg",
52
- "polygon": [[0, 0], [0, 40], [20, 40], [20, 0]],
53
- "rotation_angle": 0,
54
- "mirrored": False,
55
- },
56
- {
57
- "id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa0",
58
- "type_id": "baaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
59
- "name": "element 2",
60
- "confidence": 1,
61
- "image_id": "aaa2aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
62
- "image_width": 138,
63
- "image_height": 76,
64
- "image_url": "http://somewhere.com/iiif/image.jpeg",
65
- "polygon": [[0, 0], [0, 40], [20, 40], [20, 0]],
66
- "rotation_angle": 0,
67
- "mirrored": False,
68
- },
69
- ],
70
- ),
71
- ],
72
- )
73
- def test_list_process_elements_with_image(
74
- responses, mock_elements_worker, with_image, elements
75
- ):
76
- responses.add(
77
- responses.GET,
78
- f"http://testserver/api/v1/process/{PROCESS_ID}/elements/?page_size=500&with_count=true&with_image={with_image}",
79
- status=200,
80
- json={
81
- "count": 2,
82
- "next": None,
83
- "results": elements,
84
- },
85
- )
86
- assert (
87
- list(mock_elements_worker.list_process_elements(with_image=with_image))
88
- == elements
89
- )