Skip to content

Commit 000c388

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 0ac827d commit 000c388

71 files changed

Lines changed: 345 additions & 1090 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/driven_cavity/driven_cavity.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def erturk_u(NN):
160160
)
161161

162162
velocity = u.ProbeData(pts, "Velocity")
163-
(ilen, jlen) = velocity.shape
163+
ilen, jlen = velocity.shape
164164
norm = 0.0
165165
for i in range(ilen):
166166
diff = pts[i][3] - velocity[i][0]
@@ -217,7 +217,7 @@ def erturk_v(NN):
217217
)
218218

219219
velocity = u.ProbeData(pts, "Velocity")
220-
(ilen, jlen) = velocity.shape
220+
ilen, jlen = velocity.shape
221221
norm = 0.0
222222
for i in range(ilen):
223223
diff = pts[i][3] - velocity[i][1]
@@ -269,7 +269,7 @@ def botella_u(NN):
269269
)
270270

271271
velocity = u.ProbeData(pts, "Velocity")
272-
(ilen, jlen) = velocity.shape
272+
ilen, jlen = velocity.shape
273273
norm = 0.0
274274
for i in range(ilen):
275275
diff = pts[i][3] - velocity[i][0]
@@ -320,7 +320,7 @@ def botella_v(NN):
320320
)
321321

322322
velocity = u.ProbeData(pts, "Velocity")
323-
(ilen, jlen) = velocity.shape
323+
ilen, jlen = velocity.shape
324324

325325
norm = 0.0
326326
for i in range(ilen):
@@ -372,7 +372,7 @@ def botella_p1(NN):
372372
)
373373

374374
velocity = u.ProbeData(pts, "Velocity")
375-
(ilen, jlen) = velocity.shape
375+
ilen, jlen = velocity.shape
376376
pressure = u.ProbeData(pts, "Pressure")
377377

378378
pts0 = np.array(
@@ -430,7 +430,7 @@ def botella_p2(NN):
430430
)
431431

432432
velocity = u.ProbeData(pts, "Velocity")
433-
(ilen, jlen) = velocity.shape
433+
ilen, jlen = velocity.shape
434434
pressure = u.ProbeData(pts, "Pressure")
435435

436436
pts0 = np.array(

examples/driven_cavity/generate_mesh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ optparser = OptionParser(
1212
description="""Generate the mesh files for a given resolution.""",
1313
)
1414

15-
(options, argv) = optparser.parse_args()
15+
options, argv = optparser.parse_args()
1616

1717
try:
1818
NN = int(argv[0])

examples/driven_cavity/plot_data

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ import pylab
77

88

99
def usage():
10-
print(
11-
"""plot_data <NN>
10+
print("""plot_data <NN>
1211
13-
<NN> is a space-separated list of the inverse mesh spacing."""
14-
)
12+
<NN> is a space-separated list of the inverse mesh spacing.""")
1513

1614

1715
try:

examples/lock_exchange/plot_data.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@
1515
def Froudenumber(flmlname):
1616
print("\n********** Calculating the Froude number\n")
1717
# warn user about assumptions
18-
print(
19-
"""Froude number calculations makes three assumptions:
18+
print("""Froude number calculations makes three assumptions:
2019
i) domain height = 0.1m
2120
ii) mid point domain is at x = 0.4
22-
iii) initial temperature difference is 1.0 degC"""
23-
)
21+
iii) initial temperature difference is 1.0 degC""")
2422
domainheight = 0.1
2523
domainmid = 0.4
2624
rho_zero, T_zero, alpha, g = le_tools.Getconstantsfromflml(flmlname)
@@ -184,11 +182,9 @@ def Froudenumber(flmlname):
184182
def mixing(flmlname):
185183
print("\n********** Calculating the mixing diagnostics\n")
186184
# warn user about assumptions
187-
print(
188-
"""Background potential energy calculations makes two assumptions:
185+
print("""Background potential energy calculations makes two assumptions:
189186
i) domain height = 0.1m
190-
ii) initial temperature difference is 1.0 degC"""
191-
)
187+
ii) initial temperature difference is 1.0 degC""")
192188
domainheight = 0.1
193189
rho_zero, T_zero, alpha, g = le_tools.Getconstantsfromflml(flmlname)
194190

examples/rotating_channel/plot_data

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ import pylab
77

88

99
def usage():
10-
print(
11-
"""plot_data <layers>
10+
print("""plot_data <layers>
1211
13-
<layers> is a space-separated list of layer counts."""
14-
)
12+
<layers> is a space-separated list of layer counts.""")
1513

1614

1715
try:

examples/tides_in_the_Mediterranean_Sea/Med-tides-probe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
)
7676

7777
M2amp = u.ProbeData(pts, "M2amp")
78-
(ilen, jlen) = M2amp.shape
78+
ilen, jlen = M2amp.shape
7979
S2amp = u.ProbeData(pts, "S2amp")
8080
K1amp = u.ProbeData(pts, "K1amp")
8181
O1amp = u.ProbeData(pts, "O1amp")

examples/top_hat/visualise.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66
try:
77
import vtktools
88
except ImportError:
9-
sys.stderr.write(
10-
"""You need to add the path to <FLUIDITY_SOURCE_LOCATION>/python/
9+
sys.stderr.write("""You need to add the path to <FLUIDITY_SOURCE_LOCATION>/python/
1110
to your PYTHONPATH environment variable, e.g.:
12-
export PYTHONPATH=$PYTHONPATH:$HOME/svn/fluidity/python/\n"""
13-
)
11+
export PYTHONPATH=$PYTHONPATH:$HOME/svn/fluidity/python/\n""")
1412
sys.exit(1)
1513

1614
# open one of the vtus output by fluidity

mayavi/mayavi_amcg/filters/boundary_marker_editor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ def perform_mask(self):
193193
# value is the new cell_id of the corresponding cell in the masked grid
194194
self._cell_mappings = list(
195195
map(
196-
lambda masked, cell_id: None
197-
if masked
198-
else unmasked_cells_list.insert_next_id(cell_id),
196+
lambda masked, cell_id: (
197+
None if masked else unmasked_cells_list.insert_next_id(cell_id)
198+
),
199199
in_masked,
200200
cell_ids,
201201
)

mayavi/mayavi_amcg/filters/data_set_clipper.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
Wouldn't have been able to code this otherwise.
88
99
"""
10+
1011
from traits.api import Button, Instance
1112
from traitsui.api import Group, Item, View
1213
from tvtk.api import tvtk

mayavi/mayavi_amcg/filters/field_operations.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,12 @@ class FieldOperations(Filter):
6161
"z-component",
6262
"Python function",
6363
)
64-
custom_function = Code(
65-
"""
64+
custom_function = Code("""
6665
# Define a single-line operation in terms of
6766
# the variable 'inputs' which is an array of
6867
# input arrays. math and numpy are imported.
6968
# The operation must return a single array.
70-
"""
71-
)
69+
""")
7270

7371
# Input and output fields
7472
scale_factor = Float(1.0)

0 commit comments

Comments
 (0)