@@ -1185,10 +1185,9 @@ def activate(self, targets='all', suffix=''):
1185
1185
1186
1186
Parameters
1187
1187
----------
1188
-
1189
- targets: int, list of ints, or 'all'
1188
+ targets : int, list of ints, or 'all'
1190
1189
The engines on which the view's magics will run
1191
- suffix: str [default: '']
1190
+ suffix : str [default: '']
1192
1191
The suffix, if any, for the magics. This allows you to have
1193
1192
multiple views associated with parallel magics at the same time.
1194
1193
@@ -1270,18 +1269,16 @@ def wait(self, jobs=None, timeout=-1):
1270
1269
1271
1270
Parameters
1272
1271
----------
1273
-
1274
1272
jobs : int, str, or list of ints and/or strs, or one or more AsyncResult objects
1275
- ints are indices to self.history
1276
- strs are msg_ids
1277
- default: wait on all outstanding messages
1273
+ ints are indices to self.history
1274
+ strs are msg_ids
1275
+ default: wait on all outstanding messages
1278
1276
timeout : float
1279
- a time in seconds, after which to give up.
1280
- default is -1, which means no timeout
1277
+ a time in seconds, after which to give up.
1278
+ default is -1, which means no timeout
1281
1279
1282
1280
Returns
1283
1281
-------
1284
-
1285
1282
True : when all msg_ids are done
1286
1283
False : timeout reached, some msg_ids still outstanding
1287
1284
"""
@@ -1356,7 +1353,6 @@ def abort(self, jobs=None, targets=None, block=None):
1356
1353
1357
1354
Parameters
1358
1355
----------
1359
-
1360
1356
jobs : msg_id, list of msg_ids, or AsyncResult
1361
1357
The jobs to be aborted
1362
1358
@@ -1405,14 +1401,13 @@ def shutdown(self, targets='all', restart=False, hub=False, block=None):
1405
1401
1406
1402
Parameters
1407
1403
----------
1408
-
1409
- targets: list of ints or 'all' [default: all]
1404
+ targets : list of ints or 'all' [default: all]
1410
1405
Which engines to shutdown.
1411
- hub: bool [default: False]
1406
+ hub : bool [default: False]
1412
1407
Whether to include the Hub. hub=True implies targets='all'.
1413
- block: bool [default: self.block]
1408
+ block : bool [default: self.block]
1414
1409
Whether to wait for clean shutdown replies or not.
1415
- restart: bool [default: False]
1410
+ restart : bool [default: False]
1416
1411
NOT IMPLEMENTED
1417
1412
whether to restart engines after shutting them down.
1418
1413
"""
@@ -1466,22 +1461,20 @@ def become_dask(
1466
1461
1467
1462
Parameters
1468
1463
----------
1469
-
1470
- targets: target spec (default: all)
1464
+ targets : target spec (default: all)
1471
1465
Which engines to turn into dask workers.
1472
- port: int (default: random)
1466
+ port : int (default: random)
1473
1467
Which port
1474
- nanny: bool (default: False)
1468
+ nanny : bool (default: False)
1475
1469
Whether to start workers as subprocesses instead of in the engine process.
1476
1470
Using a nanny allows restarting the worker processes via ``executor.restart``.
1477
- scheduler_args: dict
1471
+ scheduler_args : dict
1478
1472
Keyword arguments (e.g. ip) to pass to the distributed.Scheduler constructor.
1479
- **worker_args:
1473
+ **worker_args
1480
1474
Any additional keyword arguments (e.g. ncores) are passed to the distributed.Worker constructor.
1481
1475
1482
1476
Returns
1483
1477
-------
1484
-
1485
1478
client = distributed.Client
1486
1479
A dask.distributed.Client connected to the dask cluster.
1487
1480
"""
@@ -1527,8 +1520,7 @@ def stop_dask(self, targets='all'):
1527
1520
1528
1521
Parameters
1529
1522
----------
1530
-
1531
- targets: target spec (default: all)
1523
+ targets : target spec (default: all)
1532
1524
Which engines to stop dask workers on.
1533
1525
"""
1534
1526
dview = self .direct_view (targets )
@@ -1665,10 +1657,9 @@ def load_balanced_view(self, targets=None, **kwargs):
1665
1657
1666
1658
Parameters
1667
1659
----------
1668
-
1669
- targets: list,slice,int,etc. [default: use all engines]
1660
+ targets : list,slice,int,etc. [default: use all engines]
1670
1661
The subset of engines across which to load-balance execution
1671
- kwargs: passed to LoadBalancedView
1662
+ ** kwargs : passed to LoadBalancedView
1672
1663
"""
1673
1664
if targets == 'all' :
1674
1665
targets = None
@@ -1683,13 +1674,11 @@ def executor(self, targets=None):
1683
1674
1684
1675
Parameters
1685
1676
----------
1686
-
1687
- targets: list,slice,int,etc. [default: use all engines]
1677
+ targets : list,slice,int,etc. [default: use all engines]
1688
1678
The subset of engines across which to load-balance execution
1689
1679
1690
1680
Returns
1691
1681
-------
1692
-
1693
1682
executor: Executor
1694
1683
The Executor object
1695
1684
"""
@@ -1709,10 +1698,9 @@ def direct_view(self, targets='all', **kwargs):
1709
1698
1710
1699
Parameters
1711
1700
----------
1712
-
1713
- targets: list,slice,int,etc. [default: use all engines]
1701
+ targets : list,slice,int,etc. [default: use all engines]
1714
1702
The engines to use for the View
1715
- kwargs: passed to DirectView
1703
+ ** kwargs : passed to DirectView
1716
1704
"""
1717
1705
single = isinstance (targets , int )
1718
1706
# allow 'all' to be lazily evaluated at each execution
@@ -1731,11 +1719,10 @@ def broadcast_view(self, targets='all', is_coalescing=False, **kwargs):
1731
1719
1732
1720
Parameters
1733
1721
----------
1734
-
1735
- targets: list,slice,int,etc. [default: use all engines]
1722
+ targets : list,slice,int,etc. [default: use all engines]
1736
1723
The subset of engines across which to load-balance execution
1737
- is_coalescing: scheduler collects all messages from engines and returns them as one
1738
- kwargs: passed to BroadCastView
1724
+ is_coalescing : scheduler collects all messages from engines and returns them as one
1725
+ ** kwargs : passed to BroadCastView
1739
1726
"""
1740
1727
targets = self ._build_targets (targets )[1 ]
1741
1728
@@ -1771,11 +1758,9 @@ def get_result(self, indices_or_msg_ids=None, block=None, owner=True):
1771
1758
1772
1759
Parameters
1773
1760
----------
1774
-
1775
1761
indices_or_msg_ids : integer history index, str msg_id, AsyncResult,
1776
1762
or a list of same.
1777
1763
The indices or msg_ids of indices to be retrieved
1778
-
1779
1764
block : bool
1780
1765
Whether to wait for the result to be done
1781
1766
owner : bool [default: True]
@@ -1786,10 +1771,8 @@ def get_result(self, indices_or_msg_ids=None, block=None, owner=True):
1786
1771
1787
1772
Returns
1788
1773
-------
1789
-
1790
1774
AsyncResult
1791
1775
A single AsyncResult object will always be returned.
1792
-
1793
1776
AsyncHubResult
1794
1777
A subclass of AsyncResult that retrieves results from the Hub
1795
1778
@@ -1812,16 +1795,13 @@ def resubmit(self, indices_or_msg_ids=None, metadata=None, block=None):
1812
1795
1813
1796
Parameters
1814
1797
----------
1815
-
1816
1798
indices_or_msg_ids : integer history index, str msg_id, or list of either
1817
1799
The indices or msg_ids of indices to be retrieved
1818
-
1819
1800
block : bool
1820
1801
Whether to wait for the result to be done
1821
1802
1822
1803
Returns
1823
1804
-------
1824
-
1825
1805
AsyncHubResult
1826
1806
A subclass of AsyncResult that retrieves results from the Hub
1827
1807
@@ -1855,7 +1835,6 @@ def result_status(self, msg_ids, status_only=True):
1855
1835
1856
1836
Parameters
1857
1837
----------
1858
-
1859
1838
msg_ids : list of msg_ids
1860
1839
if int:
1861
1840
Passed as index to self.history for convenience.
@@ -1865,7 +1844,6 @@ def result_status(self, msg_ids, status_only=True):
1865
1844
1866
1845
Returns
1867
1846
-------
1868
-
1869
1847
results : dict
1870
1848
There will always be the keys 'pending' and 'completed', which will
1871
1849
be lists of msg_ids that are incomplete or complete. If `status_only`
@@ -1952,12 +1930,11 @@ def queue_status(self, targets='all', verbose=False):
1952
1930
1953
1931
Parameters
1954
1932
----------
1955
-
1956
1933
targets : int/str/list of ints/strs
1957
- the engines whose states are to be queried.
1958
- default : all
1934
+ the engines whose states are to be queried.
1935
+ default : all
1959
1936
verbose : bool
1960
- Whether to return lengths only, or lists of ids for each element
1937
+ Whether to return lengths only, or lists of ids for each element
1961
1938
"""
1962
1939
if targets == 'all' :
1963
1940
# allow 'all' to be evaluated on the engine
@@ -2068,15 +2045,13 @@ def purge_local_results(self, jobs=[], targets=[]):
2068
2045
2069
2046
Parameters
2070
2047
----------
2071
-
2072
2048
jobs : str or list of str or AsyncResult objects
2073
- the msg_ids whose results should be purged.
2049
+ the msg_ids whose results should be purged.
2074
2050
targets : int/list of ints
2075
- The engines, by integer ID, whose entire result histories are to be purged.
2051
+ The engines, by integer ID, whose entire result histories are to be purged.
2076
2052
2077
2053
Raises
2078
2054
------
2079
-
2080
2055
RuntimeError : if any of the tasks to be purged are still outstanding.
2081
2056
2082
2057
"""
@@ -2117,13 +2092,12 @@ def purge_hub_results(self, jobs=[], targets=[]):
2117
2092
2118
2093
Parameters
2119
2094
----------
2120
-
2121
2095
jobs : str or list of str or AsyncResult objects
2122
- the msg_ids whose results should be forgotten.
2096
+ the msg_ids whose results should be forgotten.
2123
2097
targets : int/str/list of ints/strs
2124
- The targets, by int_id, whose entire history is to be purged.
2098
+ The targets, by int_id, whose entire history is to be purged.
2125
2099
2126
- default : None
2100
+ default : None
2127
2101
"""
2128
2102
if not targets and not jobs :
2129
2103
raise ValueError ("Must specify at least one of `targets` and `jobs`" )
@@ -2156,13 +2130,12 @@ def purge_results(self, jobs=[], targets=[]):
2156
2130
2157
2131
Parameters
2158
2132
----------
2159
-
2160
2133
jobs : str or list of str or AsyncResult objects
2161
- the msg_ids whose results should be forgotten.
2134
+ the msg_ids whose results should be forgotten.
2162
2135
targets : int/str/list of ints/strs
2163
- The targets, by int_id, whose entire history is to be purged.
2136
+ The targets, by int_id, whose entire history is to be purged.
2164
2137
2165
- default : None
2138
+ default : None
2166
2139
"""
2167
2140
self .purge_local_results (jobs = jobs , targets = targets )
2168
2141
self .purge_hub_results (jobs = jobs , targets = targets )
@@ -2188,9 +2161,8 @@ def hub_history(self):
2188
2161
2189
2162
Returns
2190
2163
-------
2191
-
2192
2164
msg_ids : list of strs
2193
- list of all msg_ids, ordered by task submission time.
2165
+ list of all msg_ids, ordered by task submission time.
2194
2166
"""
2195
2167
2196
2168
reply = self ._send_recv (self ._query_stream , "history_request" , content = {})
@@ -2207,7 +2179,6 @@ def db_query(self, query, keys=None):
2207
2179
2208
2180
Parameters
2209
2181
----------
2210
-
2211
2182
query : mongodb query dict
2212
2183
The search dict. See mongodb query docs for details.
2213
2184
keys : list of strs [optional]
0 commit comments