Skip to content

Commit 046741a

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

12 files changed

Lines changed: 80 additions & 63 deletions

File tree

‎.pre-commit-config.yaml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ci:
33

44
repos:
55
- repo: https://github.com/astral-sh/ruff-pre-commit
6-
rev: f12be1ebaa5351c1fc76472de98db2c3446c8253 # frozen: v0.16.10
6+
rev: f12be1ebaa5351c1fc76472de98db2c3446c8253 # frozen: v0.16.10
77
hooks:
88
- id: ruff
99
args:
@@ -33,12 +33,12 @@ repos:
3333
# isort rules get confused in the temporary files
3434
- --ignore=I
3535
- repo: https://github.com/rbubley/mirrors-prettier
36-
rev: ef4a397f916211b4a39ccf9d3d9cbb6562157251 # frozen: v3.9.9
36+
rev: ef4a397f916211b4a39ccf9d3d9cbb6562157251 # frozen: v3.9.9
3737
hooks:
3838
- id: prettier
3939

4040
- repo: https://github.com/zizmorcore/zizmor-pre-commit
41-
rev: fa412071e4f5d44d44f9e365f4676f9df92456a2 # frozen: v1.30.1
41+
rev: fa412071e4f5d44d44f9e365f4676f9df92456a2 # frozen: v1.30.1
4242
hooks:
4343
- id: zizmor
4444
args:

‎docs/source/index.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,14 @@ You can similarly run MPI code using IPyParallel (requires [mpi4py](https://mpi4
6565
```python
6666
import ipyparallel as ipp
6767

68+
6869
def mpi_example():
6970
from mpi4py import MPI
71+
7072
comm = MPI.COMM_WORLD
7173
return f"Hello World from rank {comm.Get_rank()}. total ranks={comm.Get_size()}"
7274

75+
7376
# request an MPI cluster with 4 engines
7477
with ipp.Cluster(engines='mpi', n=4) as rc:
7578
# get a broadcast_view on the cluster which is best

‎docs/source/reference/db.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ or in your {file}`ipcontroller_config.py`:
2222

2323
```python
2424
c.IPController.db_class = "NoDB"
25-
c.IPController.db_class = "DictDB" # default
25+
c.IPController.db_class = "DictDB" # default
2626
c.IPController.db_class = "MongoDB"
2727
c.IPController.db_class = "SQLiteDB"
2828
```

‎docs/source/reference/details.md‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,14 @@ def f(a):
104104
def inner():
105105
# inner will have a closure
106106
return a
107+
107108
return inner
108109

110+
109111
f1 = f(1)
110112
f2 = f(2)
111-
f1() # returns 1
112-
f2() # returns 2
113+
f1() # returns 1
114+
f2() # returns 2
113115
```
114116

115117
`f1` and `f2` will have closures referring to the scope in which `inner` was defined,
@@ -126,12 +128,15 @@ def g(b):
126128
def inner():
127129
# this inner will *not* have a closure
128130
return a
131+
129132
return inner
133+
134+
130135
g1 = g(1)
131136
g2 = g(2)
132-
g1() # raises NameError on 'a'
133-
a=5
134-
g2() # returns 5
137+
g1() # raises NameError on 'a'
138+
a = 5
139+
g2() # returns 5
135140
```
136141

137142
`g1` and `g2` _will_ be sendable with IPython, and will treat the engine's namespace as

‎docs/source/reference/launchers.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ and can be selected via short lowercase string naming the kind of launcher, e.g.
2222

2323
```python
2424
import ipyparallel as ipp
25+
2526
c = ipp.Cluster(engines="mpi")
2627
```
2728

@@ -102,6 +103,8 @@ For example:
102103
```python
103104
from traitlets import Integer
104105
from ipyparallel.cluster.launcher import EngineLauncher
106+
107+
105108
class MyLauncher(EngineLauncher):
106109
pid = Integer(
107110
help="The pid of the process",

‎docs/source/reference/messages.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ data_pub messages are constructed via the {func}`ipyparallel.datapub.publish_dat
319319

320320
```python
321321
from ipyparallel.datapub import publish_data
322+
322323
ns = dict(x=my_array)
323324
publish_data(ns)
324325
```

‎docs/source/reference/mpi.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,11 @@ distributed array. Save the following text in a file called {file}`psum.py`:
8989
from mpi4py import MPI
9090
import numpy as np
9191

92+
9293
def psum(a):
9394
locsum = np.sum(a)
9495
rcvBuf = np.array(0.0, 'd')
95-
MPI.COMM_WORLD.Allreduce([locsum, MPI.DOUBLE],
96-
[rcvBuf, MPI.DOUBLE],
97-
op=MPI.SUM)
96+
MPI.COMM_WORLD.Allreduce([locsum, MPI.DOUBLE], [rcvBuf, MPI.DOUBLE], op=MPI.SUM)
9897
return rcvBuf
9998
```
10099

‎docs/source/reference/security.md‎

Lines changed: 30 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -111,24 +111,21 @@ circumstances:
111111

112112
```python
113113
{
114-
"ssh": "",
115-
"interface": "tcp://127.0.0.1",
116-
"registration": 54886,
117-
"control": 54888,
118-
"mux": 54890,
119-
"hb_ping": 54891,
120-
"hb_pong": 54892,
121-
"task": 54894,
122-
"iopub": 54896,
123-
"broadcast": [
124-
54900,
125-
54901
126-
],
127-
"key": "7e99e423-c437d4daf7cf23ee84cae803",
128-
"location": "mylaptop",
129-
"pack": "json",
130-
"unpack": "json",
131-
"signature_scheme": "hmac-sha256"
114+
"ssh": "",
115+
"interface": "tcp://127.0.0.1",
116+
"registration": 54886,
117+
"control": 54888,
118+
"mux": 54890,
119+
"hb_ping": 54891,
120+
"hb_pong": 54892,
121+
"task": 54894,
122+
"iopub": 54896,
123+
"broadcast": [54900, 54901],
124+
"key": "7e99e423-c437d4daf7cf23ee84cae803",
125+
"location": "mylaptop",
126+
"pack": "json",
127+
"unpack": "json",
128+
"signature_scheme": "hmac-sha256",
132129
}
133130
```
134131

@@ -143,25 +140,21 @@ $> ipcontroller --ip=* --ssh=login.mycluster.com
143140

144141
```python
145142
{
146-
"ssh": "login.mycluster.com",
147-
"interface": "tcp://*",
148-
"registration": 55836,
149-
"control": 55837,
150-
"mux": 55839,
151-
"task": 55843,
152-
"task_scheme": "lru",
153-
"iopub": 55845,
154-
"notification": 55852,
155-
"broadcast": [
156-
55847,
157-
55848,
158-
55849
159-
],
160-
"key": "70bc97ac-e66ac5143885ca8b376d4cb7",
161-
"location": "mylaptop",
162-
"pack": "json",
163-
"unpack": "json",
164-
"signature_scheme": "hmac-sha256"
143+
"ssh": "login.mycluster.com",
144+
"interface": "tcp://*",
145+
"registration": 55836,
146+
"control": 55837,
147+
"mux": 55839,
148+
"task": 55843,
149+
"task_scheme": "lru",
150+
"iopub": 55845,
151+
"notification": 55852,
152+
"broadcast": [55847, 55848, 55849],
153+
"key": "70bc97ac-e66ac5143885ca8b376d4cb7",
154+
"location": "mylaptop",
155+
"pack": "json",
156+
"unpack": "json",
157+
"signature_scheme": "hmac-sha256",
165158
}
166159
```
167160

‎docs/source/tutorial/direct.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Option 1. starting a new cluster
2121

2222
```python
2323
import ipyparallel as ipp
24+
2425
cluster = ipp.Cluster(n=4)
2526
cluster.start_cluster_sync()
2627
```
@@ -32,6 +33,7 @@ or a JupyterLab extension.
3233

3334
```python
3435
import ipyparallel as ipp
36+
3537
cluster = ipp.Cluster.from_file()
3638
```
3739

‎docs/source/tutorial/intro.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ For example:
242242

243243
```python
244244
import ipyparallel as ipp
245+
245246
# start cluster, connect client
246247
with ipp.Cluster(n=4) as rc:
247248
e_all = rc[:]

0 commit comments

Comments
 (0)