Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #380

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exclude: configure|\.*.msh|\.*.rng|^h5hut/\.*|^libjudy\.*|^libmba2d\.*|^libmba3d\.*|^libspud\.*|^spatialindex-1.8.0\.*
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: check-ast
- id: check-builtin-literals
Expand All @@ -20,20 +20,20 @@ repos:
exclude: ref_vtk_hexahedra.vtu
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.6.0
rev: v3.19.0
hooks:
- id: pyupgrade
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 7.1.1
hooks:
- id: flake8
args: ["--max-line-length", "88", "--extend-ignore", "E203,E722"]
6 changes: 3 additions & 3 deletions mayavi/mayavi_amcg/filters/boundary_marker_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ def perform_mask(self):
# value is the new cell_id of the corresponding cell in the masked grid
self._cell_mappings = list(
map(
lambda masked, cell_id: None
if masked
else unmasked_cells_list.insert_next_id(cell_id),
lambda masked, cell_id: (
None if masked else unmasked_cells_list.insert_next_id(cell_id)
),
in_masked,
cell_ids,
)
Expand Down
15 changes: 3 additions & 12 deletions python/fluidity/ocean_biology.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ def pznd(state, parameters):
G_P = (g * p_P * P_n**2 * Z_n) / (k**2 + p_P * P_n**2 + p_D * D_n**2)

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

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

# Chl growth scaling factor
# R_P=(theta_m/theta)*J*(Q_N+Q_A)/(alpha*I_n+1e-7)
R_P = (
(theta_m / theta)
* (Q_N + Q_A)
* v
/ (v**2 + alpha**2 * I_n**2) ** 0.5
)
R_P = (theta_m / theta) * (Q_N + Q_A) * v / (v**2 + alpha**2 * I_n**2) ** 0.5

# Primary production
X_P = J * (Q_N + Q_A) * P_n
Expand All @@ -350,9 +343,7 @@ def six_component(state, parameters):
# G_D = (g * epsilon * (1 - p_P) * D_n**2 * Z_n) / (
# g + epsilon * (p_P * P_n**2 + p_D * D_n**2)
# )
G_D = (g * (1 - p_P) * D_n**2 * Z_n) / (
epsilon + (p_P * P_n**2 + p_D * D_n**2)
)
G_D = (g * (1 - p_P) * D_n**2 * Z_n) / (epsilon + (p_P * P_n**2 + p_D * D_n**2))

# Death rate of phytoplankton.
# There is an additional linear term because we have a unified model
Expand Down
4 changes: 1 addition & 3 deletions tests/netcdf_read_free_surface/height.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ def function(position):
xg = 3.0 * position[0]
yg = 3.0 * position[1]
h1 = multivariate_normal.pdf([xg, yg], cov=[[1, 0], [0, 1]])
h2 = multivariate_normal.pdf(
[xg, yg], mean=[1, 1], cov=[[1.5**2, 0], [0, 0.5**2]]
)
h2 = multivariate_normal.pdf([xg, yg], mean=[1, 1], cov=[[1.5**2, 0], [0, 0.5**2]])
h = 10.0 * (h1 - h2)
return h
6 changes: 3 additions & 3 deletions tests/square-convection/checkpoint/change_options
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ for i in range(len(flml_options) - 1):
line = flml_options[i]
if "<simulation_name>" in line:
# Change the simulation name
flml_options[
i + 1
] = '<string_value lines="1">square-convection-picked-up</string_value>\n'
flml_options[i + 1] = (
'<string_value lines="1">square-convection-picked-up</string_value>\n'
)

for i in range(len(flml_options)):
if "<checkpointing>" in flml_options[i]:
Expand Down
120 changes: 24 additions & 96 deletions tests/viscous_fs_simpletopbottom/solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ def t0_eta():
- (delta_rho * k**2 * mu + k**2 * mu * rhog) * D * cosh(D * k) ** 2
- (delta_rho * k * mu + k * mu * rhog) * sinh(D * k) * cosh(D * k)
- sqrt(
(
delta_rho**2 * k**2
+ 2 * delta_rho * k**2 * rhog
+ k**2 * rhog**2
)
(delta_rho**2 * k**2 + 2 * delta_rho * k**2 * rhog + k**2 * rhog**2)
* D**2
* cosh(D * k) ** 4
- 2
Expand All @@ -61,11 +57,7 @@ def t0_eta():
* sinh(D * k)
* cosh(D * k) ** 3
+ (
(
delta_rho**2 * k**2
- 2 * delta_rho * k**2 * rhog
+ k**2 * rhog**2
)
(delta_rho**2 * k**2 - 2 * delta_rho * k**2 * rhog + k**2 * rhog**2)
* D**2
- 4 * delta_rho * rhog
)
Expand Down Expand Up @@ -97,11 +89,7 @@ def t0_xi():
- (delta_rho * k**2 * mu + k**2 * mu * rhog) * D * cosh(D * k) ** 2
- (delta_rho * k * mu + k * mu * rhog) * sinh(D * k) * cosh(D * k)
+ sqrt(
(
delta_rho**2 * k**2
+ 2 * delta_rho * k**2 * rhog
+ k**2 * rhog**2
)
(delta_rho**2 * k**2 + 2 * delta_rho * k**2 * rhog + k**2 * rhog**2)
* D**2
* cosh(D * k) ** 4
- 2
Expand All @@ -115,11 +103,7 @@ def t0_xi():
* sinh(D * k)
* cosh(D * k) ** 3
+ (
(
delta_rho**2 * k**2
- 2 * delta_rho * k**2 * rhog
+ k**2 * rhog**2
)
(delta_rho**2 * k**2 - 2 * delta_rho * k**2 * rhog + k**2 * rhog**2)
* D**2
- 4 * delta_rho * rhog
)
Expand Down Expand Up @@ -175,17 +159,12 @@ def nond_F(x, t):
+ delta_rho * k**2
+ k**2 * rhog
- sqrt(
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2)
* sinh(k) ** 4
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2) * sinh(k) ** 4
+ delta_rho**2 * k**2
+ 2 * delta_rho * k**2 * rhog
+ k**2 * rhog**2
+ 2
* (
delta_rho**2 * k
+ 2 * delta_rho * k * rhog
+ k * rhog**2
)
* (delta_rho**2 * k + 2 * delta_rho * k * rhog + k * rhog**2)
* sinh(k)
* cosh(k)
+ (
Expand Down Expand Up @@ -273,17 +252,12 @@ def nond_F(x, t):
+ delta_rho * k**2
+ k**2 * rhog
+ sqrt(
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2)
* sinh(k) ** 4
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2) * sinh(k) ** 4
+ delta_rho**2 * k**2
+ 2 * delta_rho * k**2 * rhog
+ k**2 * rhog**2
+ 2
* (
delta_rho**2 * k
+ 2 * delta_rho * k * rhog
+ k * rhog**2
)
* (delta_rho**2 * k + 2 * delta_rho * k * rhog + k * rhog**2)
* sinh(k)
* cosh(k)
+ (
Expand Down Expand Up @@ -385,11 +359,7 @@ def nond_F(x, t):
+ (delta_rho * k - k * rhog) * cosh(k) ** 2
- sqrt(
delta_rho**2 * k**2 * sinh(k) ** 4
- 2
* delta_rho**2
* k**2
* sinh(k) ** 2
* cosh(k) ** 2
- 2 * delta_rho**2 * k**2 * sinh(k) ** 2 * cosh(k) ** 2
+ delta_rho**2 * k**2 * cosh(k) ** 4
- 2 * delta_rho * k**2 * rhog * sinh(k) ** 4
+ 2 * delta_rho * k**2 * rhog * cosh(k) ** 4
Expand Down Expand Up @@ -420,11 +390,7 @@ def nond_F(x, t):
+ (delta_rho * k - k * rhog) * cosh(k) ** 2
+ sqrt(
delta_rho**2 * k**2 * sinh(k) ** 4
- 2
* delta_rho**2
* k**2
* sinh(k) ** 2
* cosh(k) ** 2
- 2 * delta_rho**2 * k**2 * sinh(k) ** 2 * cosh(k) ** 2
+ delta_rho**2 * k**2 * cosh(k) ** 4
- 2 * delta_rho * k**2 * rhog * sinh(k) ** 4
+ 2 * delta_rho * k**2 * rhog * cosh(k) ** 4
Expand Down Expand Up @@ -482,17 +448,12 @@ def nond_F(x, t):
+ delta_rho * k**2
+ k**2 * rhog
+ sqrt(
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2)
* sinh(k) ** 4
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2) * sinh(k) ** 4
+ delta_rho**2 * k**2
+ 2 * delta_rho * k**2 * rhog
+ k**2 * rhog**2
+ 2
* (
delta_rho**2 * k
+ 2 * delta_rho * k * rhog
+ k * rhog**2
)
* (delta_rho**2 * k + 2 * delta_rho * k * rhog + k * rhog**2)
* sinh(k)
* cosh(k)
+ (
Expand Down Expand Up @@ -522,17 +483,12 @@ def nond_F(x, t):
+ delta_rho * k**2
+ k**2 * rhog
- sqrt(
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2)
* sinh(k) ** 4
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2) * sinh(k) ** 4
+ delta_rho**2 * k**2
+ 2 * delta_rho * k**2 * rhog
+ k**2 * rhog**2
+ 2
* (
delta_rho**2 * k
+ 2 * delta_rho * k * rhog
+ k * rhog**2
)
* (delta_rho**2 * k + 2 * delta_rho * k * rhog + k * rhog**2)
* sinh(k)
* cosh(k)
+ (
Expand Down Expand Up @@ -666,17 +622,12 @@ def nond_G(x, t):
+ delta_rho * k**2
+ k**2 * rhog
- sqrt(
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2)
* sinh(k) ** 4
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2) * sinh(k) ** 4
+ delta_rho**2 * k**2
+ 2 * delta_rho * k**2 * rhog
+ k**2 * rhog**2
+ 2
* (
delta_rho**2 * k
+ 2 * delta_rho * k * rhog
+ k * rhog**2
)
* (delta_rho**2 * k + 2 * delta_rho * k * rhog + k * rhog**2)
* sinh(k)
* cosh(k)
+ (
Expand Down Expand Up @@ -797,17 +748,12 @@ def nond_G(x, t):
+ delta_rho * k**2
+ k**2 * rhog
+ sqrt(
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2)
* sinh(k) ** 4
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2) * sinh(k) ** 4
+ delta_rho**2 * k**2
+ 2 * delta_rho * k**2 * rhog
+ k**2 * rhog**2
+ 2
* (
delta_rho**2 * k
+ 2 * delta_rho * k * rhog
+ k * rhog**2
)
* (delta_rho**2 * k + 2 * delta_rho * k * rhog + k * rhog**2)
* sinh(k)
* cosh(k)
+ (
Expand Down Expand Up @@ -937,11 +883,7 @@ def nond_G(x, t):
+ (delta_rho * k - k * rhog) * cosh(k) ** 2
- sqrt(
delta_rho**2 * k**2 * sinh(k) ** 4
- 2
* delta_rho**2
* k**2
* sinh(k) ** 2
* cosh(k) ** 2
- 2 * delta_rho**2 * k**2 * sinh(k) ** 2 * cosh(k) ** 2
+ delta_rho**2 * k**2 * cosh(k) ** 4
- 2 * delta_rho * k**2 * rhog * sinh(k) ** 4
+ 2 * delta_rho * k**2 * rhog * cosh(k) ** 4
Expand Down Expand Up @@ -972,11 +914,7 @@ def nond_G(x, t):
+ (delta_rho * k - k * rhog) * cosh(k) ** 2
+ sqrt(
delta_rho**2 * k**2 * sinh(k) ** 4
- 2
* delta_rho**2
* k**2
* sinh(k) ** 2
* cosh(k) ** 2
- 2 * delta_rho**2 * k**2 * sinh(k) ** 2 * cosh(k) ** 2
+ delta_rho**2 * k**2 * cosh(k) ** 4
- 2 * delta_rho * k**2 * rhog * sinh(k) ** 4
+ 2 * delta_rho * k**2 * rhog * cosh(k) ** 4
Expand Down Expand Up @@ -1040,17 +978,12 @@ def nond_G(x, t):
+ delta_rho * k**2
+ k**2 * rhog
+ sqrt(
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2)
* sinh(k) ** 4
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2) * sinh(k) ** 4
+ delta_rho**2 * k**2
+ 2 * delta_rho * k**2 * rhog
+ k**2 * rhog**2
+ 2
* (
delta_rho**2 * k
+ 2 * delta_rho * k * rhog
+ k * rhog**2
)
* (delta_rho**2 * k + 2 * delta_rho * k * rhog + k * rhog**2)
* sinh(k)
* cosh(k)
+ (
Expand Down Expand Up @@ -1106,17 +1039,12 @@ def nond_G(x, t):
+ delta_rho * k**2
+ k**2 * rhog
- sqrt(
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2)
* sinh(k) ** 4
(delta_rho**2 - 2 * delta_rho * rhog + rhog**2) * sinh(k) ** 4
+ delta_rho**2 * k**2
+ 2 * delta_rho * k**2 * rhog
+ k**2 * rhog**2
+ 2
* (
delta_rho**2 * k
+ 2 * delta_rho * k * rhog
+ k * rhog**2
)
* (delta_rho**2 * k + 2 * delta_rho * k * rhog + k * rhog**2)
* sinh(k)
* cosh(k)
+ (
Expand Down
Loading
Loading