esd-services-api-client 2.5.3__py3-none-any.whl → 2.5.5__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.
- esd_services_api_client/__init__.py +1 -1
- esd_services_api_client/nexus/algorithms/__init__.py +1 -0
- esd_services_api_client/nexus/algorithms/_remote_algorithm.py +2 -0
- esd_services_api_client/nexus/algorithms/forked_algorithm.py +9 -7
- {esd_services_api_client-2.5.3.dist-info → esd_services_api_client-2.5.5.dist-info}/METADATA +1 -1
- {esd_services_api_client-2.5.3.dist-info → esd_services_api_client-2.5.5.dist-info}/RECORD +8 -8
- {esd_services_api_client-2.5.3.dist-info → esd_services_api_client-2.5.5.dist-info}/LICENSE +0 -0
- {esd_services_api_client-2.5.3.dist-info → esd_services_api_client-2.5.5.dist-info}/WHEEL +0 -0
@@ -21,3 +21,4 @@ from esd_services_api_client.nexus.algorithms.minimalistic import *
|
|
21
21
|
from esd_services_api_client.nexus.algorithms.recursive import *
|
22
22
|
from esd_services_api_client.nexus.algorithms.distributed import *
|
23
23
|
from esd_services_api_client.nexus.algorithms._baseline_algorithm import *
|
24
|
+
from esd_services_api_client.nexus.algorithms._remote_algorithm import *
|
@@ -23,6 +23,7 @@ from functools import partial
|
|
23
23
|
|
24
24
|
from adapta.metrics import MetricsProvider
|
25
25
|
from adapta.utils.decorators import run_time_metrics_async
|
26
|
+
from injector import inject
|
26
27
|
|
27
28
|
from esd_services_api_client.crystal import CrystalConnector, AlgorithmConfiguration
|
28
29
|
from esd_services_api_client.nexus.abstractions.algrorithm_cache import InputCache
|
@@ -43,6 +44,7 @@ class RemoteAlgorithm(NexusObject[TPayload, AlgorithmResult]):
|
|
43
44
|
Base class for all algorithm implementations.
|
44
45
|
"""
|
45
46
|
|
47
|
+
@inject
|
46
48
|
def __init__(
|
47
49
|
self,
|
48
50
|
metrics_provider: MetricsProvider,
|
@@ -143,8 +143,15 @@ class ForkedAlgorithm(NexusObject[TPayload, AlgorithmResult]):
|
|
143
143
|
|
144
144
|
return await self._main_run(**run_args)
|
145
145
|
|
146
|
+
if await self._is_forked(**kwargs):
|
147
|
+
self._inputs = await self._fork_inputs(**kwargs)
|
148
|
+
else:
|
149
|
+
self._inputs = await self._main_inputs(**kwargs)
|
150
|
+
|
146
151
|
# evaluate if additional forks will be spawned
|
147
|
-
forks = await
|
152
|
+
forks: list[RemoteAlgorithm] = await partial(
|
153
|
+
self._get_forks, **self._inputs, **kwargs
|
154
|
+
)()
|
148
155
|
|
149
156
|
if len(forks) > 0:
|
150
157
|
self._logger.info(
|
@@ -154,11 +161,6 @@ class ForkedAlgorithm(NexusObject[TPayload, AlgorithmResult]):
|
|
154
161
|
else:
|
155
162
|
self._logger.info("Leaf algorithm node: proceeding with this node run only")
|
156
163
|
|
157
|
-
if self._is_forked(**kwargs):
|
158
|
-
self._inputs = await self._fork_inputs(**kwargs)
|
159
|
-
else:
|
160
|
-
self._inputs = await self._main_inputs(**kwargs)
|
161
|
-
|
162
164
|
run_result = await partial(
|
163
165
|
_measured_run,
|
164
166
|
**self._inputs,
|
@@ -168,6 +170,6 @@ class ForkedAlgorithm(NexusObject[TPayload, AlgorithmResult]):
|
|
168
170
|
)()
|
169
171
|
|
170
172
|
# now await callback scheduling
|
171
|
-
await asyncio.wait([fork.run(**kwargs) for fork in forks])
|
173
|
+
await asyncio.wait([asyncio.create_task(fork.run(**kwargs)) for fork in forks])
|
172
174
|
|
173
175
|
return run_result
|
@@ -1,4 +1,4 @@
|
|
1
|
-
esd_services_api_client/__init__.py,sha256=
|
1
|
+
esd_services_api_client/__init__.py,sha256=cflkta41RmD1JnoBW1Gvl0oM9YJL8ETNEkbaFjixCxE,648
|
2
2
|
esd_services_api_client/beast/__init__.py,sha256=zNhXcHSP5w4P9quM1XP4oXVJEccvC_VScG41TZ0GzZ8,723
|
3
3
|
esd_services_api_client/beast/v3/__init__.py,sha256=FtumtInoDyCCRE424Llqv8QZLRuwXzj-smyfu1od1nc,754
|
4
4
|
esd_services_api_client/beast/v3/_connector.py,sha256=VqxiCzJWKERh42aZAIphzmOEG5cdOcKM0DQzG7eQ_-8,11479
|
@@ -22,11 +22,11 @@ esd_services_api_client/nexus/abstractions/input_object.py,sha256=RUKnhekuZwd_RV
|
|
22
22
|
esd_services_api_client/nexus/abstractions/logger_factory.py,sha256=9biONvCqNrP__yrmeRkoDL05TMA5v-LyrcKwgiKG59U,2019
|
23
23
|
esd_services_api_client/nexus/abstractions/nexus_object.py,sha256=rLE42imCVGE6Px4Yu6X6C4b69gA1grK-7Md_SuCLN2Q,3115
|
24
24
|
esd_services_api_client/nexus/abstractions/socket_provider.py,sha256=Rwa_aPErI4Es5AdyCd3EoGze7mg2D70u8kuc2UGEBaI,1729
|
25
|
-
esd_services_api_client/nexus/algorithms/__init__.py,sha256=
|
25
|
+
esd_services_api_client/nexus/algorithms/__init__.py,sha256=v4rPDf36r6AaHi_3K8isBKYU_fG8ct3w14KpUg2XRgg,976
|
26
26
|
esd_services_api_client/nexus/algorithms/_baseline_algorithm.py,sha256=24ALLx4Bxlgi0EwZB1a0SJeEwBUWKj7CGad-CpIygU0,2925
|
27
|
-
esd_services_api_client/nexus/algorithms/_remote_algorithm.py,sha256=
|
27
|
+
esd_services_api_client/nexus/algorithms/_remote_algorithm.py,sha256=IdTKdNbFirrUM9H2mTnk-vlbObEwyG8xRQZbauf6CEQ,3940
|
28
28
|
esd_services_api_client/nexus/algorithms/distributed.py,sha256=vkKSCsd480RKwrtu3uZ2iU1bh593fkgBcOBrcb9cLjA,1702
|
29
|
-
esd_services_api_client/nexus/algorithms/forked_algorithm.py,sha256=
|
29
|
+
esd_services_api_client/nexus/algorithms/forked_algorithm.py,sha256=eOHnlIS1SWVl_Cq91Q852bFLbvJonaDtQ4RWvjIPlTY,5858
|
30
30
|
esd_services_api_client/nexus/algorithms/minimalistic.py,sha256=tSYXodIW-_Aje-_ZyYUoWAThcZIeE4_kMvMINsT4Lb8,1644
|
31
31
|
esd_services_api_client/nexus/algorithms/recursive.py,sha256=uaCCl4q-st_KqbcmkdOJedJ0nAjbJvn6jdZEdW0_0ss,2007
|
32
32
|
esd_services_api_client/nexus/configurations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -47,7 +47,7 @@ esd_services_api_client/nexus/input/payload_reader.py,sha256=Kq0xN1Shyqv71v6Ykcr
|
|
47
47
|
esd_services_api_client/nexus/telemetry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
48
48
|
esd_services_api_client/nexus/telemetry/recorder.py,sha256=j4x-wOSNZHkFco-ENlKtSm22d4WGHmuzKMnzvGQAtlQ,4849
|
49
49
|
esd_services_api_client/nexus/telemetry/user_telemetry_recorder.py,sha256=NOcb2l1SkMHinBXSrfbiBZSpufzhBWkuh3Px3NXrkcg,4997
|
50
|
-
esd_services_api_client-2.5.
|
51
|
-
esd_services_api_client-2.5.
|
52
|
-
esd_services_api_client-2.5.
|
53
|
-
esd_services_api_client-2.5.
|
50
|
+
esd_services_api_client-2.5.5.dist-info/LICENSE,sha256=0gS6zXsPp8qZhzi1xaGCIYPzb_0e8on7HCeFJe8fOpw,10693
|
51
|
+
esd_services_api_client-2.5.5.dist-info/METADATA,sha256=Ob-YZC1AN0GgeNRgpw5R7mEIXD-hkbsx7xV8lWfgFuU,1232
|
52
|
+
esd_services_api_client-2.5.5.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
53
|
+
esd_services_api_client-2.5.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|