Skip to content

Commit 5af5ad5

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

File tree

14 files changed

+250
-981
lines changed

14 files changed

+250
-981
lines changed

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
)

python/fluidity/ocean_biology.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ def pznd(state, parameters):
6868
G_P = (g * p_P * P_n**2 * Z_n) / (k**2 + p_P * P_n**2 + p_D * D_n**2)
6969

7070
# Zooplankton grazing of detritus.
71-
G_D = (g * (1 - p_P) * D_n**2 * Z_n) / (
72-
k**2 + p_P * P_n**2 + p_D * D_n**2
73-
)
71+
G_D = (g * (1 - p_P) * D_n**2 * Z_n) / (k**2 + p_P * P_n**2 + p_D * D_n**2)
7472

7573
# Death rate of phytoplankton.
7674
De_P = mu_P * P_n * P_n / (P_n + 0.2)
@@ -327,12 +325,7 @@ def six_component(state, parameters):
327325

328326
# Chl growth scaling factor
329327
# R_P=(theta_m/theta)*J*(Q_N+Q_A)/(alpha*I_n+1e-7)
330-
R_P = (
331-
(theta_m / theta)
332-
* (Q_N + Q_A)
333-
* v
334-
/ (v**2 + alpha**2 * I_n**2) ** 0.5
335-
)
328+
R_P = (theta_m / theta) * (Q_N + Q_A) * v / (v**2 + alpha**2 * I_n**2) ** 0.5
336329

337330
# Primary production
338331
X_P = J * (Q_N + Q_A) * P_n
@@ -350,9 +343,7 @@ def six_component(state, parameters):
350343
# G_D = (g * epsilon * (1 - p_P) * D_n**2 * Z_n) / (
351344
# g + epsilon * (p_P * P_n**2 + p_D * D_n**2)
352345
# )
353-
G_D = (g * (1 - p_P) * D_n**2 * Z_n) / (
354-
epsilon + (p_P * P_n**2 + p_D * D_n**2)
355-
)
346+
G_D = (g * (1 - p_P) * D_n**2 * Z_n) / (epsilon + (p_P * P_n**2 + p_D * D_n**2))
356347

357348
# Death rate of phytoplankton.
358349
# There is an additional linear term because we have a unified model

tests/netcdf_read_free_surface/height.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ def function(position):
66
xg = 3.0 * position[0]
77
yg = 3.0 * position[1]
88
h1 = multivariate_normal.pdf([xg, yg], cov=[[1, 0], [0, 1]])
9-
h2 = multivariate_normal.pdf(
10-
[xg, yg], mean=[1, 1], cov=[[1.5**2, 0], [0, 0.5**2]]
11-
)
9+
h2 = multivariate_normal.pdf([xg, yg], mean=[1, 1], cov=[[1.5**2, 0], [0, 0.5**2]])
1210
h = 10.0 * (h1 - h2)
1311
return h

tests/square-convection/checkpoint/change_options

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ for i in range(len(flml_options) - 1):
1717
line = flml_options[i]
1818
if "<simulation_name>" in line:
1919
# Change the simulation name
20-
flml_options[
21-
i + 1
22-
] = '<string_value lines="1">square-convection-picked-up</string_value>\n'
20+
flml_options[i + 1] = (
21+
'<string_value lines="1">square-convection-picked-up</string_value>\n'
22+
)
2323

2424
for i in range(len(flml_options)):
2525
if "<checkpointing>" in flml_options[i]:

tests/viscous_fs_simpletopbottom/solution.py

Lines changed: 24 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,7 @@ def t0_eta():
4343
- (delta_rho * k**2 * mu + k**2 * mu * rhog) * D * cosh(D * k) ** 2
4444
- (delta_rho * k * mu + k * mu * rhog) * sinh(D * k) * cosh(D * k)
4545
- sqrt(
46-
(
47-
delta_rho**2 * k**2
48-
+ 2 * delta_rho * k**2 * rhog
49-
+ k**2 * rhog**2
50-
)
46+
(delta_rho**2 * k**2 + 2 * delta_rho * k**2 * rhog + k**2 * rhog**2)
5147
* D**2
5248
* cosh(D * k) ** 4
5349
- 2
@@ -61,11 +57,7 @@ def t0_eta():
6157
* sinh(D * k)
6258
* cosh(D * k) ** 3
6359
+ (
64-
(
65-
delta_rho**2 * k**2
66-
- 2 * delta_rho * k**2 * rhog
67-
+ k**2 * rhog**2
68-
)
60+
(delta_rho**2 * k**2 - 2 * delta_rho * k**2 * rhog + k**2 * rhog**2)
6961
* D**2
7062
- 4 * delta_rho * rhog
7163
)
@@ -97,11 +89,7 @@ def t0_xi():
9789
- (delta_rho * k**2 * mu + k**2 * mu * rhog) * D * cosh(D * k) ** 2
9890
- (delta_rho * k * mu + k * mu * rhog) * sinh(D * k) * cosh(D * k)
9991
+ sqrt(
100-
(
101-
delta_rho**2 * k**2
102-
+ 2 * delta_rho * k**2 * rhog
103-
+ k**2 * rhog**2
104-
)
92+
(delta_rho**2 * k**2 + 2 * delta_rho * k**2 * rhog + k**2 * rhog**2)
10593
* D**2
10694
* cosh(D * k) ** 4
10795
- 2
@@ -115,11 +103,7 @@ def t0_xi():
115103
* sinh(D * k)
116104
* cosh(D * k) ** 3
117105
+ (
118-
(
119-
delta_rho**2 * k**2
120-
- 2 * delta_rho * k**2 * rhog
121-
+ k**2 * rhog**2
122-
)
106+
(delta_rho**2 * k**2 - 2 * delta_rho * k**2 * rhog + k**2 * rhog**2)
123107
* D**2
124108
- 4 * delta_rho * rhog
125109
)
@@ -175,17 +159,12 @@ def nond_F(x, t):
175159
+ delta_rho * k**2
176160
+ k**2 * rhog
177161
- sqrt(
178-
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2)
179-
* sinh(k) ** 4
162+
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2) * sinh(k) ** 4
180163
+ delta_rho**2 * k**2
181164
+ 2 * delta_rho * k**2 * rhog
182165
+ k**2 * rhog**2
183166
+ 2
184-
* (
185-
delta_rho**2 * k
186-
+ 2 * delta_rho * k * rhog
187-
+ k * rhog**2
188-
)
167+
* (delta_rho**2 * k + 2 * delta_rho * k * rhog + k * rhog**2)
189168
* sinh(k)
190169
* cosh(k)
191170
+ (
@@ -273,17 +252,12 @@ def nond_F(x, t):
273252
+ delta_rho * k**2
274253
+ k**2 * rhog
275254
+ sqrt(
276-
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2)
277-
* sinh(k) ** 4
255+
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2) * sinh(k) ** 4
278256
+ delta_rho**2 * k**2
279257
+ 2 * delta_rho * k**2 * rhog
280258
+ k**2 * rhog**2
281259
+ 2
282-
* (
283-
delta_rho**2 * k
284-
+ 2 * delta_rho * k * rhog
285-
+ k * rhog**2
286-
)
260+
* (delta_rho**2 * k + 2 * delta_rho * k * rhog + k * rhog**2)
287261
* sinh(k)
288262
* cosh(k)
289263
+ (
@@ -385,11 +359,7 @@ def nond_F(x, t):
385359
+ (delta_rho * k - k * rhog) * cosh(k) ** 2
386360
- sqrt(
387361
delta_rho**2 * k**2 * sinh(k) ** 4
388-
- 2
389-
* delta_rho**2
390-
* k**2
391-
* sinh(k) ** 2
392-
* cosh(k) ** 2
362+
- 2 * delta_rho**2 * k**2 * sinh(k) ** 2 * cosh(k) ** 2
393363
+ delta_rho**2 * k**2 * cosh(k) ** 4
394364
- 2 * delta_rho * k**2 * rhog * sinh(k) ** 4
395365
+ 2 * delta_rho * k**2 * rhog * cosh(k) ** 4
@@ -420,11 +390,7 @@ def nond_F(x, t):
420390
+ (delta_rho * k - k * rhog) * cosh(k) ** 2
421391
+ sqrt(
422392
delta_rho**2 * k**2 * sinh(k) ** 4
423-
- 2
424-
* delta_rho**2
425-
* k**2
426-
* sinh(k) ** 2
427-
* cosh(k) ** 2
393+
- 2 * delta_rho**2 * k**2 * sinh(k) ** 2 * cosh(k) ** 2
428394
+ delta_rho**2 * k**2 * cosh(k) ** 4
429395
- 2 * delta_rho * k**2 * rhog * sinh(k) ** 4
430396
+ 2 * delta_rho * k**2 * rhog * cosh(k) ** 4
@@ -482,17 +448,12 @@ def nond_F(x, t):
482448
+ delta_rho * k**2
483449
+ k**2 * rhog
484450
+ sqrt(
485-
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2)
486-
* sinh(k) ** 4
451+
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2) * sinh(k) ** 4
487452
+ delta_rho**2 * k**2
488453
+ 2 * delta_rho * k**2 * rhog
489454
+ k**2 * rhog**2
490455
+ 2
491-
* (
492-
delta_rho**2 * k
493-
+ 2 * delta_rho * k * rhog
494-
+ k * rhog**2
495-
)
456+
* (delta_rho**2 * k + 2 * delta_rho * k * rhog + k * rhog**2)
496457
* sinh(k)
497458
* cosh(k)
498459
+ (
@@ -522,17 +483,12 @@ def nond_F(x, t):
522483
+ delta_rho * k**2
523484
+ k**2 * rhog
524485
- sqrt(
525-
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2)
526-
* sinh(k) ** 4
486+
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2) * sinh(k) ** 4
527487
+ delta_rho**2 * k**2
528488
+ 2 * delta_rho * k**2 * rhog
529489
+ k**2 * rhog**2
530490
+ 2
531-
* (
532-
delta_rho**2 * k
533-
+ 2 * delta_rho * k * rhog
534-
+ k * rhog**2
535-
)
491+
* (delta_rho**2 * k + 2 * delta_rho * k * rhog + k * rhog**2)
536492
* sinh(k)
537493
* cosh(k)
538494
+ (
@@ -666,17 +622,12 @@ def nond_G(x, t):
666622
+ delta_rho * k**2
667623
+ k**2 * rhog
668624
- sqrt(
669-
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2)
670-
* sinh(k) ** 4
625+
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2) * sinh(k) ** 4
671626
+ delta_rho**2 * k**2
672627
+ 2 * delta_rho * k**2 * rhog
673628
+ k**2 * rhog**2
674629
+ 2
675-
* (
676-
delta_rho**2 * k
677-
+ 2 * delta_rho * k * rhog
678-
+ k * rhog**2
679-
)
630+
* (delta_rho**2 * k + 2 * delta_rho * k * rhog + k * rhog**2)
680631
* sinh(k)
681632
* cosh(k)
682633
+ (
@@ -797,17 +748,12 @@ def nond_G(x, t):
797748
+ delta_rho * k**2
798749
+ k**2 * rhog
799750
+ sqrt(
800-
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2)
801-
* sinh(k) ** 4
751+
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2) * sinh(k) ** 4
802752
+ delta_rho**2 * k**2
803753
+ 2 * delta_rho * k**2 * rhog
804754
+ k**2 * rhog**2
805755
+ 2
806-
* (
807-
delta_rho**2 * k
808-
+ 2 * delta_rho * k * rhog
809-
+ k * rhog**2
810-
)
756+
* (delta_rho**2 * k + 2 * delta_rho * k * rhog + k * rhog**2)
811757
* sinh(k)
812758
* cosh(k)
813759
+ (
@@ -937,11 +883,7 @@ def nond_G(x, t):
937883
+ (delta_rho * k - k * rhog) * cosh(k) ** 2
938884
- sqrt(
939885
delta_rho**2 * k**2 * sinh(k) ** 4
940-
- 2
941-
* delta_rho**2
942-
* k**2
943-
* sinh(k) ** 2
944-
* cosh(k) ** 2
886+
- 2 * delta_rho**2 * k**2 * sinh(k) ** 2 * cosh(k) ** 2
945887
+ delta_rho**2 * k**2 * cosh(k) ** 4
946888
- 2 * delta_rho * k**2 * rhog * sinh(k) ** 4
947889
+ 2 * delta_rho * k**2 * rhog * cosh(k) ** 4
@@ -972,11 +914,7 @@ def nond_G(x, t):
972914
+ (delta_rho * k - k * rhog) * cosh(k) ** 2
973915
+ sqrt(
974916
delta_rho**2 * k**2 * sinh(k) ** 4
975-
- 2
976-
* delta_rho**2
977-
* k**2
978-
* sinh(k) ** 2
979-
* cosh(k) ** 2
917+
- 2 * delta_rho**2 * k**2 * sinh(k) ** 2 * cosh(k) ** 2
980918
+ delta_rho**2 * k**2 * cosh(k) ** 4
981919
- 2 * delta_rho * k**2 * rhog * sinh(k) ** 4
982920
+ 2 * delta_rho * k**2 * rhog * cosh(k) ** 4
@@ -1040,17 +978,12 @@ def nond_G(x, t):
1040978
+ delta_rho * k**2
1041979
+ k**2 * rhog
1042980
+ sqrt(
1043-
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2)
1044-
* sinh(k) ** 4
981+
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2) * sinh(k) ** 4
1045982
+ delta_rho**2 * k**2
1046983
+ 2 * delta_rho * k**2 * rhog
1047984
+ k**2 * rhog**2
1048985
+ 2
1049-
* (
1050-
delta_rho**2 * k
1051-
+ 2 * delta_rho * k * rhog
1052-
+ k * rhog**2
1053-
)
986+
* (delta_rho**2 * k + 2 * delta_rho * k * rhog + k * rhog**2)
1054987
* sinh(k)
1055988
* cosh(k)
1056989
+ (
@@ -1106,17 +1039,12 @@ def nond_G(x, t):
11061039
+ delta_rho * k**2
11071040
+ k**2 * rhog
11081041
- sqrt(
1109-
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2)
1110-
* sinh(k) ** 4
1042+
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2) * sinh(k) ** 4
11111043
+ delta_rho**2 * k**2
11121044
+ 2 * delta_rho * k**2 * rhog
11131045
+ k**2 * rhog**2
11141046
+ 2
1115-
* (
1116-
delta_rho**2 * k
1117-
+ 2 * delta_rho * k * rhog
1118-
+ k * rhog**2
1119-
)
1047+
* (delta_rho**2 * k + 2 * delta_rho * k * rhog + k * rhog**2)
11201048
* sinh(k)
11211049
* cosh(k)
11221050
+ (

0 commit comments

Comments
 (0)