esd-services-api-client 2.0.5__tar.gz → 2.0.6__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.
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/PKG-INFO +1 -1
- esd_services_api_client-2.0.6/esd_services_api_client/_version.py +1 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/README.md +3 -10
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/algorithms/_baseline_algorithm.py +19 -4
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/algorithms/minimalistic.py +2 -2
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/algorithms/recursive.py +3 -5
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/input/_functions.py +1 -1
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/pyproject.toml +1 -1
- esd_services_api_client-2.0.5/esd_services_api_client/_version.py +0 -1
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/LICENSE +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/README.md +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/__init__.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/beast/__init__.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/beast/v3/__init__.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/beast/v3/_connector.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/beast/v3/_models.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/boxer/README.md +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/boxer/__init__.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/boxer/_auth.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/boxer/_base.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/boxer/_connector.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/boxer/_models.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/common/__init__.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/crystal/__init__.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/crystal/_api_versions.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/crystal/_connector.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/crystal/_models.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/__init__.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/abstractions/__init__.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/abstractions/logger_factory.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/abstractions/nexus_object.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/abstractions/socket_provider.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/algorithms/__init__.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/algorithms/distributed.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/configurations/__init__.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/configurations/algorithm_configuration.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/core/__init__.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/core/app_core.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/core/app_dependencies.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/exceptions/__init__.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/exceptions/_nexus_error.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/exceptions/input_reader_error.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/exceptions/startup_error.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/input/__init__.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/input/input_processor.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/input/input_reader.py +0 -0
- {esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/nexus/input/payload_reader.py +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = '2.0.6'
|
@@ -239,17 +239,10 @@ class MyAlgorithm(MinimalisticAlgorithm):
|
|
239
239
|
pass
|
240
240
|
|
241
241
|
@inject
|
242
|
-
def __init__(
|
243
|
-
|
244
|
-
input_processor: MyInputProcessor,
|
245
|
-
metrics_provider: MetricsProvider,
|
246
|
-
logger_factory: LoggerFactory,
|
247
|
-
):
|
248
|
-
super().__init__(input_processor, metrics_provider, logger_factory)
|
242
|
+
def __init__(self, metrics_provider: MetricsProvider, logger_factory: LoggerFactory, input_processor: MyInputProcessor):
|
243
|
+
super().__init__(metrics_provider, logger_factory, input_processor)
|
249
244
|
|
250
|
-
async def _run(
|
251
|
-
self, x_ready: PandasDataFrame, y_ready: PandasDataFrame, **kwargs
|
252
|
-
) -> PandasDataFrame:
|
245
|
+
async def _run(self, x_ready: PandasDataFrame, y_ready: PandasDataFrame, **kwargs) -> PandasDataFrame:
|
253
246
|
return pandas.concat([x_ready, y_ready])
|
254
247
|
|
255
248
|
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"""
|
2
2
|
Base algorithm
|
3
3
|
"""
|
4
|
+
import asyncio
|
4
5
|
|
5
6
|
# Copyright (c) 2023. ECCO Sneaks & Data
|
6
7
|
#
|
@@ -19,6 +20,7 @@
|
|
19
20
|
|
20
21
|
|
21
22
|
from abc import abstractmethod
|
23
|
+
from functools import reduce
|
22
24
|
|
23
25
|
from adapta.metrics import MetricsProvider
|
24
26
|
from pandas import DataFrame as PandasDataFrame
|
@@ -35,12 +37,12 @@ class BaselineAlgorithm(NexusObject):
|
|
35
37
|
|
36
38
|
def __init__(
|
37
39
|
self,
|
38
|
-
input_processor: InputProcessor,
|
39
40
|
metrics_provider: MetricsProvider,
|
40
41
|
logger_factory: LoggerFactory,
|
42
|
+
*input_processors: InputProcessor,
|
41
43
|
):
|
42
44
|
super().__init__(metrics_provider, logger_factory)
|
43
|
-
self.
|
45
|
+
self._input_processors = input_processors
|
44
46
|
|
45
47
|
@abstractmethod
|
46
48
|
async def _run(self, **kwargs) -> PandasDataFrame:
|
@@ -52,5 +54,18 @@ class BaselineAlgorithm(NexusObject):
|
|
52
54
|
"""
|
53
55
|
Coroutine that executes the algorithm logic.
|
54
56
|
"""
|
55
|
-
|
56
|
-
|
57
|
+
|
58
|
+
async def _process(processor: InputProcessor) -> dict[str, PandasDataFrame]:
|
59
|
+
async with processor as instance:
|
60
|
+
return await instance.process_input(**kwargs)
|
61
|
+
|
62
|
+
process_tasks: dict[str, asyncio.Task] = {
|
63
|
+
input_processor.__class__.__name__.lower(): asyncio.create_task(
|
64
|
+
_process(input_processor)
|
65
|
+
)
|
66
|
+
for input_processor in self._input_processors
|
67
|
+
}
|
68
|
+
await asyncio.wait(fs=process_tasks.values())
|
69
|
+
results = [task.result() for task in process_tasks.values()]
|
70
|
+
|
71
|
+
return await self._run(**reduce(lambda a, b: a | b, results))
|
@@ -37,8 +37,8 @@ class MinimalisticAlgorithm(BaselineAlgorithm, ABC):
|
|
37
37
|
@inject
|
38
38
|
def __init__(
|
39
39
|
self,
|
40
|
-
input_processor: InputProcessor,
|
41
40
|
metrics_provider: MetricsProvider,
|
42
41
|
logger_factory: LoggerFactory,
|
42
|
+
*input_processors: InputProcessor,
|
43
43
|
):
|
44
|
-
super().__init__(
|
44
|
+
super().__init__(metrics_provider, logger_factory, *input_processors)
|
@@ -39,20 +39,18 @@ class RecursiveAlgorithm(BaselineAlgorithm):
|
|
39
39
|
@inject
|
40
40
|
def __init__(
|
41
41
|
self,
|
42
|
-
input_processor: InputProcessor,
|
43
42
|
metrics_provider: MetricsProvider,
|
44
43
|
logger_factory: LoggerFactory,
|
44
|
+
*input_processors: InputProcessor,
|
45
45
|
):
|
46
|
-
super().__init__(
|
46
|
+
super().__init__(metrics_provider, logger_factory, *input_processors)
|
47
47
|
|
48
48
|
@abstractmethod
|
49
49
|
async def _is_finished(self, **kwargs) -> bool:
|
50
50
|
""" """
|
51
51
|
|
52
52
|
async def run(self, **kwargs) -> PandasDataFrame:
|
53
|
-
result = await self._run(
|
54
|
-
**(await self._input_processor.process_input(**kwargs))
|
55
|
-
)
|
53
|
+
result = await self._run(**kwargs)
|
56
54
|
if self._is_finished(**result):
|
57
55
|
return result
|
58
56
|
return await self.run(**result)
|
@@ -62,7 +62,7 @@ async def resolve_readers(*readers: InputReader) -> Dict[str, PandasDataFrame]:
|
|
62
62
|
return await instance.read()
|
63
63
|
|
64
64
|
read_tasks: dict[str, asyncio.Task] = {
|
65
|
-
reader.
|
65
|
+
reader.alias: asyncio.create_task(_read(reader)) for reader in readers
|
66
66
|
}
|
67
67
|
await asyncio.wait(fs=read_tasks.values())
|
68
68
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "esd-services-api-client"
|
3
|
-
version = "2.0.
|
3
|
+
version = "2.0.6"
|
4
4
|
description = "Python clients for ESD services"
|
5
5
|
authors = ["ECCO Sneaks & Data <esdsupport@ecco.com>"]
|
6
6
|
maintainers = ['GZU <gzu@ecco.com>', 'JRB <ext-jrb@ecco.com>', 'VISA <visa@ecco.com>']
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = '2.0.5'
|
File without changes
|
File without changes
|
{esd_services_api_client-2.0.5 → esd_services_api_client-2.0.6}/esd_services_api_client/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|