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: 25.1.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 6.0.0
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.6.0
rev: v3.19.1
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: 4 additions & 0 deletions python/fluidity/state_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def remap_ele(self, ele_number, mesh):

class ScalarField(Field):
"A scalar field"

description = "ScalarField"

def __init__(self, n, v, ft, op):
Expand All @@ -155,6 +156,7 @@ def __init__(self, n, v, ft, op):

class VectorField(Field):
"A vector field"

description = "VectorField"

def __init__(self, n, v, ft, op, dim):
Expand All @@ -166,6 +168,7 @@ def __init__(self, n, v, ft, op, dim):

class TensorField(Field):
"A tensor field"

description = "VectorField"

def __init__(self, n, v, ft, op, dim0, dim1):
Expand Down Expand Up @@ -337,6 +340,7 @@ def eval(self, x):

class Transform:
"Transform with information about the detwei and Jacobian"

# Note that so far only the dim == ldim == (2||3) have been tested

def __init__(self, ele_num, field):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python3
"""
Python script to measure the position of the particle cloud front in
simulations of the shock tube experiment by Rogue et al. (1998).
Written by Christian Jacobs.
Python script to measure the position of the particle cloud front in
simulations of the shock tube experiment by Rogue et al. (1998).
Written by Christian Jacobs.
"""

import matplotlib.pyplot as plt
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
Loading
Loading