Skip to content

Commit

Permalink
Update client.py to be consistent with the docstring (#7705)
Browse files Browse the repository at this point in the history
  • Loading branch information
SultanOrazbayev committed Jun 27, 2023
1 parent e4b95ca commit a5beabf
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions distributed/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1839,7 +1839,7 @@ def submit(
allow_other_workers=False,
actor=False,
actors=False,
pure=None,
pure=True,
**kwargs,
):
"""Submit a function application to the scheduler
Expand Down Expand Up @@ -1880,7 +1880,9 @@ def submit(
Alias for `actor`
pure : bool (defaults to True)
Whether or not the function is pure. Set ``pure=False`` for
impure functions like ``np.random.random``.
impure functions like ``np.random.random``. Note that if both
``actor`` and ``pure`` kwargs are set to True, then the value
of ``pure`` will be reverted to False, since an actor is stateful.
See :ref:`pure functions` for more details.
**kwargs
Expand Down Expand Up @@ -1919,7 +1921,7 @@ def submit(
raise TypeError("First input to submit must be a callable function")

actor = actor or actors
if pure is None:
if actor:
pure = not actor

if allow_other_workers not in (True, False, None):
Expand Down Expand Up @@ -1978,7 +1980,7 @@ def map(
fifo_timeout="100 ms",
actor=False,
actors=False,
pure=None,
pure=True,
batch_size=None,
**kwargs,
):
Expand Down Expand Up @@ -2022,7 +2024,9 @@ def map(
Alias for `actor`
pure : bool (defaults to True)
Whether or not the function is pure. Set ``pure=False`` for
impure functions like ``np.random.random``.
impure functions like ``np.random.random``. Note that if both
``actor`` and ``pure`` kwargs are set to True, then the value
of ``pure`` will be reverted to False, since an actor is stateful.
See :ref:`pure functions` for more details.
batch_size : int, optional (default: just one batch whose size is the entire iterable)
Submit tasks to the scheduler in batches of (at most)
Expand Down Expand Up @@ -2100,7 +2104,7 @@ def map(

key = key or funcname(func)
actor = actor or actors
if pure is None:
if actor:
pure = not actor

if allow_other_workers and workers is None:
Expand Down

0 comments on commit a5beabf

Please sign in to comment.