Skip to content

Commit aaa4483

Browse files
committed
promote Cluster to top-level namespace
and add Cluster to docs
1 parent caba06b commit aaa4483

File tree

5 files changed

+11
-4
lines changed

5 files changed

+11
-4
lines changed

docs/source/api/ipyparallel.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ API Reference
1111
Classes
1212
-------
1313

14+
.. autoclass:: Cluster
15+
1416
.. autoclass:: Client
1517

1618
.. autoclass:: DirectView

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@
6060
# You can specify multiple suffix as a list of string:
6161
source_suffix = ['.rst', '.md']
6262

63-
from traitlets.config import HasTraits
63+
from traitlets.config import LoggingConfigurable
6464

6565
# exclude members inherited from HasTraits by default
6666
autodoc_default_options = {
6767
'members': None,
6868
"inherited-members": None,
69-
"exclude-members": ','.join(dir(HasTraits)),
69+
"exclude-members": ','.join(dir(LoggingConfigurable)),
7070
}
7171

7272
# Add dev disclaimer.

examples/Cluster API.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
}
4949
],
5050
"source": [
51-
"from ipyparallel.cluster import Cluster\n",
51+
"from ipyparallel import Cluster\n",
5252
"\n",
5353
"cluster = Cluster()\n",
5454
"cluster"

ipyparallel/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from .client.client import Client
1515
from .client.remotefunction import *
1616
from .client.view import *
17+
from .cluster import Cluster
1718
from .controller.dependency import *
1819
from .error import *
1920
from .serialize import *

ipyparallel/cluster/cluster.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ class Cluster(AsyncFirst, LoggingConfigurable):
4242
i.e. one controller and a groups of engines
4343
4444
Can start/stop/monitor/poll cluster resources
45+
46+
All async methods can be called synchronously with a `_sync` suffix,
47+
e.g. `cluster.start_cluster_sync()`
4548
"""
4649

4750
# general configuration
@@ -424,7 +427,7 @@ async def stop_cluster(self):
424427
await self.stop_engines()
425428
await self.stop_controller()
426429

427-
def connect_client(self):
430+
def connect_client(self, **client_kwargs):
428431
"""Return a client connected to the cluster"""
429432
# TODO: get connect info directly from controller
430433
# this assumes local files exist
@@ -434,6 +437,7 @@ def connect_client(self):
434437
cluster=self,
435438
profile_dir=self.profile_dir,
436439
cluster_id=self.cluster_id,
440+
**client_kwargs,
437441
)
438442

439443
# context managers (both async and sync)

0 commit comments

Comments
 (0)