Skip to content

Commit 5f29499

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent f4fbc8f commit 5f29499

27 files changed

+8
-37
lines changed

Diff for: benchmarks/benchmark_result.py

-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ def add_no_delay_tasks_source(source, benchmark, number_of_cores):
201201
for result in benchmark['results']
202202
if not result.failed
203203
]:
204-
205204
dict_to_append_to['Duration in ms'].append(duration)
206205
dict_to_append_to['Number of tasks'].append(tasks_num)
207206
dict_to_append_to['Number of cores'].append(number_of_cores)

Diff for: benchmarks/profiling/profiling_code_runner.py

-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ def get_tasks_to_execute(program_arguments):
6868

6969

7070
if __name__ == "__main__":
71-
7271
print('profiling_code_runner_started')
7372
if '-s' not in sys.argv:
7473
n = int(sys.argv[1]) if len(sys.argv) > 1 else 16

Diff for: docs/source/examples/customresults.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@ def sleep_here(count, t):
5858

5959
# note that each job in a map always returns a list of length chunksize
6060
# even if chunksize == 1
61-
for (count, t) in ar.get():
61+
for count, t in ar.get():
6262
print(" item %i: slept for %.2fs" % (count, t))

Diff for: docs/source/examples/daVinci Word Count/wordfreq.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def print_wordfreq(freqs, n=10):
1919
words, counts = freqs.keys(), freqs.values()
2020
items = zip(counts, words)
2121
items = sorted(items, reverse=True)
22-
for (count, word) in items[:n]:
22+
for count, word in items[:n]:
2323
print(word, count)
2424

2525

Diff for: docs/source/examples/dependencies.py

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
client = ipp.Client()
55

6+
67
# this will only run on machines that can import numpy:
78
@ipp.require('numpy')
89
def norm(A):
@@ -32,6 +33,7 @@ def getpid():
3233

3334
pid0 = client[0].apply_sync(getpid)
3435

36+
3537
# this will depend on the pid being that of target 0:
3638
@ipp.depend(checkpid, pid0)
3739
def getpid2():

Diff for: docs/source/examples/fetchparse.py

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ def fetchAndParse(url, data=None):
3737

3838

3939
class DistributedSpider:
40-
4140
# Time to wait between polling for task results.
4241
pollingDelay = 0.5
4342

Diff for: docs/source/examples/interengine/bintree.py

-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ def disambiguate_dns_url(url, location):
112112

113113

114114
class BinaryTreeCommunicator:
115-
116115
id = None
117116
pub = None
118117
sub = None

Diff for: docs/source/examples/interengine/bintree_script.py

+2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
peers = ar.get_dict()
5050
# this is a dict, keyed by engine ID, of the connection info for the EngineCommunicators
5151

52+
5253
# connect the engines to each other:
5354
def connect(com, peers, tree, pub_url, root_id):
5455
"""this function will be called on the engines"""
@@ -57,6 +58,7 @@ def connect(com, peers, tree, pub_url, root_id):
5758

5859
view.apply_sync(connect, ipp.Reference('com'), peers, btree, pub_url, root_id)
5960

61+
6062
# functions that can be used for reductions
6163
# max and min builtins can be used as well
6264
def add(a, b):

Diff for: docs/source/examples/nwmerge.py

-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ def remote_iterator(view, name):
9494

9595
# Main, interactive testing
9696
if __name__ == '__main__':
97-
9897
rc = ipp.Client()
9998
view = rc[:]
10099
print('Engine IDs:', rc.ids)

Diff for: docs/source/examples/wave2D/parallelwave-mpi.py

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ def wave_saver(u, x, y, t):
5555

5656
# main program:
5757
if __name__ == '__main__':
58-
5958
parser = argparse.ArgumentParser()
6059
paa = parser.add_argument
6160
paa(

Diff for: docs/source/examples/wave2D/parallelwave.py

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ def wave_saver(u, x, y, t):
6060

6161
# main program:
6262
if __name__ == '__main__':
63-
6463
parser = argparse.ArgumentParser()
6564
paa = parser.add_argument
6665
paa(

Diff for: docs/source/examples/wave2D/wavesolver.py

-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ def __init__(
8989
'bc': 'vectorized',
9090
},
9191
):
92-
9392
nx = partitioner.global_num_cells[0] # number of global cells in x dir
9493
ny = partitioner.global_num_cells[1] # number of global cells in y dir
9594
dx = Lx / float(nx)

Diff for: ipyparallel/apps/iploggerapp.py

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737

3838

3939
class IPLoggerApp(BaseParallelApplication):
40-
4140
name = 'iplogger'
4241
description = _description
4342
classes = [LogWatcher, ProfileDir]

Diff for: ipyparallel/client/client.py

-2
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,6 @@ def __init__(
402402
cluster=None,
403403
**extra_args,
404404
):
405-
406405
super_kwargs = {'debug': debug, 'cluster': cluster}
407406
if profile:
408407
super_kwargs['profile'] = profile
@@ -524,7 +523,6 @@ def __init__(
524523
and not sshserver
525524
and location != socket.gethostname()
526525
):
527-
528526
# warn if no ssh specified, but SSH is probably needed
529527
# This is only a warning, because the most likely cause
530528
# is a local Controller on a laptop whose IP is dynamic

Diff for: ipyparallel/cluster/_winhpcjob.py

-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ def find_username():
5555

5656

5757
class WinHPCJob(Configurable):
58-
5958
job_id = Unicode('')
6059
job_name = Unicode('MyJob', config=True)
6160
min_cores = Integer(1, config=True)
@@ -149,7 +148,6 @@ def add_task(self, task):
149148

150149

151150
class WinHPCTask(Configurable):
152-
153151
task_id = Unicode('')
154152
task_name = Unicode('')
155153
version = Unicode("2.000")
@@ -234,7 +232,6 @@ class IPEngineSetJob(WinHPCJob):
234232

235233

236234
class IPControllerTask(WinHPCTask):
237-
238235
task_name = Unicode('IPController', config=True)
239236
controller_cmd = List(['ipcontroller.exe'], config=True)
240237
controller_args = List(['--log-level=40'], config=True)
@@ -262,7 +259,6 @@ def command_line(self):
262259

263260

264261
class IPEngineTask(WinHPCTask):
265-
266262
task_name = Unicode('IPEngine', config=True)
267263
engine_cmd = List(['ipengine.exe'], config=True)
268264
engine_args = List(['--log-level=40'], config=True)

Diff for: ipyparallel/cluster/app.py

-2
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,6 @@ def start(self):
326326

327327

328328
class IPClusterEngines(BaseParallelApplication):
329-
330329
name = 'ipcluster'
331330
description = engines_help
332331
examples = _engines_examples
@@ -545,7 +544,6 @@ def start(self):
545544

546545

547546
class IPClusterStart(IPClusterEngines):
548-
549547
name = 'ipcluster'
550548
description = start_help
551549
examples = _start_examples

Diff for: ipyparallel/cluster/cluster.py

-2
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,6 @@ def __del__(self):
404404
self.stop_cluster_sync()
405405

406406
def __repr__(self):
407-
408407
fields = {
409408
"cluster_id": repr(self.cluster_id),
410409
}
@@ -1002,7 +1001,6 @@ def load_clusters(
10021001
# TODO: only if it has any ipyparallel config files
10031002
# *or* it's the default profile
10041003
if init_default_clusters and not cluster_files:
1005-
10061004
cluster = Cluster(profile_dir=profile_dir, cluster_id="")
10071005
cluster_key = self._cluster_key(cluster)
10081006
if cluster_key not in self.clusters:

Diff for: ipyparallel/cluster/launcher.py

-5
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,6 @@ def remote_connection_files(self):
13951395

13961396

13971397
class SSHControllerLauncher(SSHLauncher, ControllerLauncher):
1398-
13991398
# alias back to *non-configurable* program[_args] for use in find_args()
14001399
# this way all Controller/EngineSetLaunchers have the same form, rather
14011400
# than *some* having `program_args` and others `controller_args`
@@ -1421,7 +1420,6 @@ def _to_fetch_default(self):
14211420

14221421

14231422
class SSHEngineLauncher(SSHLauncher, EngineLauncher):
1424-
14251423
# alias back to *non-configurable* program[_args] for use in find_args()
14261424
# this way all Controller/EngineSetLaunchers have the same form, rather
14271425
# than *some* having `program_args` and others `controller_args`
@@ -1579,7 +1577,6 @@ def start(self, n):
15791577

15801578

15811579
class WindowsHPCLauncher(BaseLauncher):
1582-
15831580
job_id_regexp = CRegExp(
15841581
r'\d+',
15851582
config=True,
@@ -1663,7 +1660,6 @@ def stop(self):
16631660

16641661

16651662
class WindowsHPCControllerLauncher(WindowsHPCLauncher):
1666-
16671663
job_file_name = Unicode(
16681664
'ipcontroller_job.xml', config=True, help="WinHPC xml job file."
16691665
)
@@ -1687,7 +1683,6 @@ def write_job_file(self, n):
16871683

16881684

16891685
class WindowsHPCEngineSetLauncher(WindowsHPCLauncher):
1690-
16911686
job_file_name = Unicode(
16921687
'ipengineset_job.xml', config=True, help="jobfile for ipengines job"
16931688
)

Diff for: ipyparallel/controller/app.py

-3
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@
166166

167167

168168
class IPController(BaseParallelApplication):
169-
170169
name = 'ipcontroller'
171170
description = _description
172171
examples = _examples
@@ -996,7 +995,6 @@ def get_python_scheduler_args(
996995

997996
def launch_broadcast_schedulers(self, monitor_url, children):
998997
def launch_in_thread_or_process(scheduler_args, depth, identity):
999-
1000998
if 'Process' in self.mq_class:
1001999
# run the Python scheduler in a Process
10021000
q = Process(
@@ -1012,7 +1010,6 @@ def launch_in_thread_or_process(scheduler_args, depth, identity):
10121010
launch_broadcast_scheduler(**scheduler_args)
10131011

10141012
def recursively_start_schedulers(identity, depth):
1015-
10161013
outgoing_id1 = identity + '0'
10171014
outgoing_id2 = identity + '1'
10181015
is_leaf = depth == self.broadcast_scheduler_depth

Diff for: ipyparallel/controller/scheduler.py

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ def logged(f, self, *args, **kwargs):
3535

3636

3737
class Scheduler(LoggingConfigurable):
38-
3938
loop = Instance(ioloop.IOLoop)
4039

4140
@default("loop")

Diff for: ipyparallel/engine/app.py

-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@
103103

104104

105105
class IPEngine(BaseParallelApplication):
106-
107106
name = 'ipengine'
108107
description = _description
109108
examples = _examples

Diff for: ipyparallel/engine/datapub.py

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111

1212
class ZMQDataPublisher(Configurable):
13-
1413
topic = topic = CBytes(b'datapub')
1514
session = Instance(Session, allow_none=True)
1615
pub_socket = Any(allow_none=True)

Diff for: ipyparallel/error.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def render_traceback(self, excid=None):
170170
"""render one or all of my tracebacks to a list of lines"""
171171
lines = []
172172
if excid is None:
173-
for (en, ev, etb, ei) in self.elist[: self.tb_limit]:
173+
for en, ev, etb, ei in self.elist[: self.tb_limit]:
174174
lines.append(self._get_engine_str(ei) + ":")
175175
lines.extend((etb or 'No traceback available').splitlines())
176176
lines.append('')

Diff for: ipyparallel/tests/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ def __str__(self):
4949

5050

5151
def setup():
52-
5352
error.RemoteError = RemoteErrorWithTB
5453

5554
cluster_dir = os.path.join(get_ipython_dir(), 'profile_iptest')

Diff for: ipyparallel/tests/test_apps.py

-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ def ipcluster_list(*args):
152152

153153

154154
def test_ipcluster_list(Cluster):
155-
156155
# no clusters
157156
out = ipcluster_list()
158157
assert len(out.splitlines()) == 1

Diff for: ipyparallel/tests/test_client.py

-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
@pytest.mark.usefixtures('ipython')
2727
class TestClient(ClusterTestCase):
28-
2928
engine_count = 4
3029

3130
def test_curve(self):
@@ -685,7 +684,6 @@ def test_wait_for_engines(self):
685684
sys.platform.startswith("win"), reason="Signal tests don't pass on Windows yet"
686685
)
687686
def test_signal_engines(self):
688-
689687
view = self.client[:]
690688
if sys.platform.startswith("win"):
691689
signame = 'CTRL_C_EVENT'

Diff for: ipyparallel/tests/test_mpi.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
# import tests that use engine_launcher_class fixture
1212

13+
1314
# override engine_launcher_class
1415
@pytest.fixture
1516
def engine_launcher_class():

0 commit comments

Comments
 (0)