seamless-dask 0.1.0__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.
- seamless_dask/__init__.py +72 -0
- seamless_dask/client.py +1276 -0
- seamless_dask/dummy_scheduler.py +322 -0
- seamless_dask/permissions.py +248 -0
- seamless_dask/transformation_mixin.py +642 -0
- seamless_dask/transformer_client.py +126 -0
- seamless_dask/types.py +45 -0
- seamless_dask/worker_setup.py +168 -0
- seamless_dask/wrapper.py +1926 -0
- seamless_dask-0.1.0.dist-info/METADATA +273 -0
- seamless_dask-0.1.0.dist-info/RECORD +14 -0
- seamless_dask-0.1.0.dist-info/WHEEL +5 -0
- seamless_dask-0.1.0.dist-info/entry_points.txt +2 -0
- seamless_dask-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"""Seamless utilities for working with Dask."""
|
|
2
|
+
|
|
3
|
+
from importlib import import_module
|
|
4
|
+
from typing import TYPE_CHECKING, Any
|
|
5
|
+
|
|
6
|
+
__all__ = [
|
|
7
|
+
"SeamlessDaskClient",
|
|
8
|
+
"get_seamless_dask_client",
|
|
9
|
+
"set_seamless_dask_client",
|
|
10
|
+
"TransformationDaskMixin",
|
|
11
|
+
"DummySchedulerHandle",
|
|
12
|
+
"create_dummy_client",
|
|
13
|
+
"create_dummy_scheduler",
|
|
14
|
+
"serve_dummy_scheduler",
|
|
15
|
+
"start_dummy_scheduler",
|
|
16
|
+
"get_dummy_scheduler_address",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
# Map exported symbols to (module, attribute) for lazy loading. This prevents
|
|
20
|
+
# heavyweight dependencies such as ``distributed`` from being imported when the
|
|
21
|
+
# package is merely used as a namespace (e.g. ``import seamless_dask.wrapper``).
|
|
22
|
+
_LAZY_EXPORTS = {
|
|
23
|
+
"SeamlessDaskClient": (".client", "SeamlessDaskClient"),
|
|
24
|
+
"get_seamless_dask_client": (
|
|
25
|
+
".transformer_client",
|
|
26
|
+
"get_seamless_dask_client",
|
|
27
|
+
),
|
|
28
|
+
"set_seamless_dask_client": (
|
|
29
|
+
".transformer_client",
|
|
30
|
+
"set_seamless_dask_client",
|
|
31
|
+
),
|
|
32
|
+
"TransformationDaskMixin": (".transformation_mixin", "TransformationDaskMixin"),
|
|
33
|
+
"DummySchedulerHandle": (".dummy_scheduler", "DummySchedulerHandle"),
|
|
34
|
+
"create_dummy_client": (".dummy_scheduler", "create_dummy_client"),
|
|
35
|
+
"create_dummy_scheduler": (".dummy_scheduler", "create_dummy_scheduler"),
|
|
36
|
+
"serve_dummy_scheduler": (".dummy_scheduler", "serve_dummy_scheduler"),
|
|
37
|
+
"start_dummy_scheduler": (".dummy_scheduler", "start_dummy_scheduler"),
|
|
38
|
+
"get_dummy_scheduler_address": (
|
|
39
|
+
".dummy_scheduler",
|
|
40
|
+
"get_dummy_scheduler_address",
|
|
41
|
+
),
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if TYPE_CHECKING:
|
|
45
|
+
from .client import SeamlessDaskClient
|
|
46
|
+
from .dummy_scheduler import (
|
|
47
|
+
DummySchedulerHandle,
|
|
48
|
+
create_dummy_client,
|
|
49
|
+
create_dummy_scheduler,
|
|
50
|
+
get_dummy_scheduler_address,
|
|
51
|
+
serve_dummy_scheduler,
|
|
52
|
+
start_dummy_scheduler,
|
|
53
|
+
)
|
|
54
|
+
from .transformer_client import (
|
|
55
|
+
get_seamless_dask_client,
|
|
56
|
+
set_seamless_dask_client,
|
|
57
|
+
)
|
|
58
|
+
from .transformation_mixin import TransformationDaskMixin
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def __getattr__(name: str) -> Any:
|
|
62
|
+
target = _LAZY_EXPORTS.get(name)
|
|
63
|
+
if target is None:
|
|
64
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
65
|
+
module = import_module(target[0], __name__)
|
|
66
|
+
value = getattr(module, target[1])
|
|
67
|
+
globals()[name] = value
|
|
68
|
+
return value
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def __dir__() -> list[str]:
|
|
72
|
+
return sorted(set(list(globals().keys()) + __all__))
|