arkindex-base-worker 0.5.0b2__tar.gz → 0.5.0b3__tar.gz

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 (66) hide show
  1. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/PKG-INFO +1 -1
  2. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/arkindex_base_worker.egg-info/PKG-INFO +1 -1
  3. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/arkindex_worker/image.py +4 -2
  4. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/arkindex_worker/worker/base.py +3 -3
  5. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/pyproject.toml +1 -1
  6. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/conftest.py +0 -14
  7. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_base_worker.py +1 -1
  8. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/LICENSE +0 -0
  9. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/README.md +0 -0
  10. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/arkindex_base_worker.egg-info/SOURCES.txt +0 -0
  11. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/arkindex_base_worker.egg-info/dependency_links.txt +0 -0
  12. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/arkindex_base_worker.egg-info/requires.txt +0 -0
  13. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/arkindex_base_worker.egg-info/top_level.txt +0 -0
  14. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/arkindex_worker/__init__.py +0 -0
  15. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/arkindex_worker/cache.py +0 -0
  16. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/arkindex_worker/models.py +0 -0
  17. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/arkindex_worker/utils.py +0 -0
  18. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/arkindex_worker/worker/__init__.py +0 -0
  19. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/arkindex_worker/worker/classification.py +0 -0
  20. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/arkindex_worker/worker/corpus.py +0 -0
  21. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/arkindex_worker/worker/dataset.py +0 -0
  22. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/arkindex_worker/worker/element.py +0 -0
  23. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/arkindex_worker/worker/entity.py +0 -0
  24. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/arkindex_worker/worker/image.py +0 -0
  25. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/arkindex_worker/worker/metadata.py +0 -0
  26. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/arkindex_worker/worker/process.py +0 -0
  27. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/arkindex_worker/worker/task.py +0 -0
  28. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/arkindex_worker/worker/training.py +0 -0
  29. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/arkindex_worker/worker/transcription.py +0 -0
  30. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/examples/standalone/python/worker.py +0 -0
  31. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/examples/tooled/python/worker.py +0 -0
  32. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/hooks/pre_gen_project.py +0 -0
  33. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/setup.cfg +0 -0
  34. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/__init__.py +0 -0
  35. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_cache.py +0 -0
  36. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_dataset_worker.py +0 -0
  37. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_element.py +0 -0
  38. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_elements_worker/__init__.py +0 -0
  39. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_elements_worker/test_classification.py +0 -0
  40. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_elements_worker/test_cli.py +0 -0
  41. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_elements_worker/test_corpus.py +0 -0
  42. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_elements_worker/test_dataset.py +0 -0
  43. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_elements_worker/test_element.py +0 -0
  44. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_elements_worker/test_element_create_multiple.py +0 -0
  45. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_elements_worker/test_element_create_single.py +0 -0
  46. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_elements_worker/test_element_list_children.py +0 -0
  47. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_elements_worker/test_element_list_parents.py +0 -0
  48. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_elements_worker/test_entity_create.py +0 -0
  49. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_elements_worker/test_entity_list_and_check.py +0 -0
  50. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_elements_worker/test_image.py +0 -0
  51. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_elements_worker/test_metadata.py +0 -0
  52. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_elements_worker/test_process.py +0 -0
  53. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_elements_worker/test_task.py +0 -0
  54. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_elements_worker/test_training.py +0 -0
  55. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_elements_worker/test_transcription_create.py +0 -0
  56. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_elements_worker/test_transcription_create_with_elements.py +0 -0
  57. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_elements_worker/test_transcription_list.py +0 -0
  58. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_elements_worker/test_worker.py +0 -0
  59. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_image.py +0 -0
  60. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_merge.py +0 -0
  61. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/tests/test_utils.py +0 -0
  62. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/worker-demo/tests/__init__.py +0 -0
  63. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/worker-demo/tests/conftest.py +0 -0
  64. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/worker-demo/tests/test_worker.py +0 -0
  65. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/worker-demo/worker_demo/__init__.py +0 -0
  66. {arkindex_base_worker-0.5.0b2 → arkindex_base_worker-0.5.0b3}/worker-demo/worker_demo/worker.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: arkindex-base-worker
3
- Version: 0.5.0b2
3
+ Version: 0.5.0b3
4
4
  Summary: Base Worker to easily build Arkindex ML workflows
5
5
  Author-email: Teklia <contact@teklia.com>
6
6
  Maintainer-email: Teklia <contact@teklia.com>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: arkindex-base-worker
3
- Version: 0.5.0b2
3
+ Version: 0.5.0b3
4
4
  Summary: Base Worker to easily build Arkindex ML workflows
5
5
  Author-email: Teklia <contact@teklia.com>
6
6
  Maintainer-email: Teklia <contact@teklia.com>
@@ -24,7 +24,8 @@ from tenacity import (
24
24
  retry,
25
25
  retry_if_exception_type,
26
26
  stop_after_attempt,
27
- wait_exponential,
27
+ wait_chain,
28
+ wait_fixed,
28
29
  )
29
30
 
30
31
  from arkindex_worker import VERSION, logger
@@ -334,7 +335,8 @@ def _retry_log(retry_state, *args, **kwargs):
334
335
 
335
336
  @retry(
336
337
  stop=stop_after_attempt(3),
337
- wait=wait_exponential(multiplier=2),
338
+ # In the event of `requests.RequestException` errors, the call will be retried after 5 seconds, 10 seconds and finally 90 seconds before failing.
339
+ wait=wait_chain(wait_fixed(5), wait_fixed(10), wait_fixed(90)),
338
340
  retry=retry_if_exception_type(requests.RequestException),
339
341
  before_sleep=_retry_log,
340
342
  reraise=True,
@@ -275,12 +275,12 @@ class BaseWorker:
275
275
  # Retrieve initial configuration from API
276
276
  self.config = worker_version["configuration"].get("configuration", {})
277
277
  if "user_configuration" in worker_version["configuration"]:
278
- # Add default values (if set) to user_configuration
278
+ # Add missing values (using the provided default if set) to user_configuration
279
279
  for key, value in worker_version["configuration"][
280
280
  "user_configuration"
281
281
  ].items():
282
- if "default" in value and key not in self.model_configuration:
283
- self.user_configuration[key] = value["default"]
282
+ if key not in self.model_configuration:
283
+ self.user_configuration[key] = value.get("default")
284
284
 
285
285
  # Load all required secrets
286
286
  required_secrets = worker_version["configuration"].get("secrets", [])
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "arkindex-base-worker"
7
- version = "0.5.0b2"
7
+ version = "0.5.0b3"
8
8
  description = "Base Worker to easily build Arkindex ML workflows"
9
9
  license = { file = "LICENSE" }
10
10
  dependencies = [
@@ -3,7 +3,6 @@ import json
3
3
  import os
4
4
  import sys
5
5
  import time
6
- from pathlib import Path
7
6
  from uuid import UUID
8
7
 
9
8
  import pytest
@@ -78,19 +77,6 @@ def _cache_yaml(monkeypatch):
78
77
  def _setup_api(responses, monkeypatch, _cache_yaml):
79
78
  # Always use the environment variable first
80
79
  schema_url = os.environ.get("ARKINDEX_API_SCHEMA_URL")
81
- if schema_url is None:
82
- # Try to load a local schema as the current developer of base-worker
83
- # may also work on the backend nearby
84
- paths = [
85
- "~/dev/ark/backend/schema.yml",
86
- "~/dev/ark/backend/output/schema.yml",
87
- ]
88
- for path in paths:
89
- path = Path(path).expanduser().absolute()
90
- if path.exists():
91
- monkeypatch.setenv("ARKINDEX_API_SCHEMA_URL", str(path))
92
- schema_url = str(path)
93
- break
94
80
 
95
81
  # Fallback to prod environment
96
82
  if schema_url is None:
@@ -803,7 +803,7 @@ def test_corpus_id_set_read_only_mode(
803
803
  },
804
804
  {},
805
805
  {},
806
- {"parameter": 0},
806
+ {"parameter": 0, "parameter2": None},
807
807
  ),
808
808
  # Keep parameters from worker version configuration but user_config defaults overrides
809
809
  (