Skip to content

Commit

Permalink
[DEVOPS-515] fix black in precommit and run it
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhmg committed Oct 19, 2024
1 parent 0098122 commit 346a6fe
Show file tree
Hide file tree
Showing 16 changed files with 65 additions and 54 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
default_language_version:
python: python3
repos:
- repo: https://github.com/psf/black
rev: 24.10.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.3.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
- id: flake8
language_version: python3
additional_dependencies:
- flake8-bugbear==23.12.2
- flake8-builtins==2.2.0
Expand Down
2 changes: 1 addition & 1 deletion simpeg/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def __init__(
relative_error=None,
noise_floor=None,
standard_deviation=None,
**kwargs
**kwargs,
):
super().__init__(**kwargs)
self.survey = survey
Expand Down
2 changes: 1 addition & 1 deletion simpeg/electromagnetics/frequency_domain/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(
forward_only=False,
permittivity=None,
storeJ=False,
**kwargs
**kwargs,
):
super().__init__(mesh=mesh, survey=survey, **kwargs)
self.forward_only = forward_only
Expand Down
2 changes: 1 addition & 1 deletion simpeg/electromagnetics/natural_source/simulation_1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(
thicknesses=None,
thicknessesMap=None,
fix_Jmatrix=False,
**kwargs
**kwargs,
):
super().__init__(mesh=None, survey=survey, **kwargs)
self.fix_Jmatrix = fix_Jmatrix
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __init__(
etaMap=None,
Ainv=None, # A DC's Ainv
_f=None, # A pre-computed DC field
**kwargs
**kwargs,
):
super().__init__(mesh=mesh, survey=survey, **kwargs)
self.sigma = sigma
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(
rho=rho,
sigmaMap=None,
rhoMap=None,
**kwargs
**kwargs,
)
self.q = q
self.qMap = qMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(
storeJ=False,
actinds=None,
storeInnerProduct=True,
**kwargs
**kwargs,
):
super().__init__(mesh=mesh, survey=survey, **kwargs)
self.tau = tau
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(
source_list=None,
survey_geometry="surface",
survey_type="dipole-dipole",
**kwargs
**kwargs,
):
if source_list is None:
raise AttributeError("Survey cannot be instantiated without sources")
Expand Down
12 changes: 6 additions & 6 deletions simpeg/flow/richards/empirical.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def __init__(
alphaMap=None,
beta=3.96,
betaMap=None,
**kwargs
**kwargs,
):
super().__init__(mesh=mesh, **kwargs)
self.theta_r = theta_r
Expand Down Expand Up @@ -224,7 +224,7 @@ def __init__(
AMap=None,
gamma=4.74,
gammaMap=None,
**kwargs
**kwargs,
):
super().__init__(mesh=mesh, **kwargs)
self.Ks = Ks
Expand Down Expand Up @@ -292,7 +292,7 @@ def haverkamp(mesh, **kwargs):
Haverkamp_theta,
["Ks", "A", "gamma"],
["alpha", "beta", "theta_r", "theta_s"],
**kwargs
**kwargs,
)


Expand Down Expand Up @@ -344,7 +344,7 @@ def __init__(
nMap=None,
alpha=0.036,
alphaMap=None,
**kwargs
**kwargs,
):
super().__init__(mesh=mesh, **kwargs)
self.theta_r = theta_r
Expand Down Expand Up @@ -499,7 +499,7 @@ def __init__(
nMap=None,
alpha=0.036,
alphaMap=None,
**kwargs
**kwargs,
):
super().__init__(mesh=mesh, **kwargs)
self.Ks = Ks
Expand Down Expand Up @@ -807,7 +807,7 @@ def van_genuchten(mesh, **kwargs):
Vangenuchten_theta,
["alpha", "n", "Ks", "I"],
["alpha", "n", "theta_r", "theta_s"],
**kwargs
**kwargs,
)


Expand Down
2 changes: 1 addition & 1 deletion simpeg/flow/richards/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(
do_newton=False,
root_finder_max_iter=30,
root_finder_tol=1e-4,
**kwargs
**kwargs,
):
debug = kwargs.pop("debug", None)
if debug is not None:
Expand Down
2 changes: 1 addition & 1 deletion simpeg/inversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(
counter=None,
debug=False,
name="BaseInversion",
**kwargs
**kwargs,
):
if directiveList is None:
directiveList = []
Expand Down
4 changes: 2 additions & 2 deletions simpeg/regularization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def __init__(self, mesh=None, alpha_x=1.0, alpha_y=1.0, alpha_z=1.0, **kwargs):
length_scale_x=alpha_x,
length_scale_y=alpha_y,
length_scale_z=alpha_z,
**kwargs
**kwargs,
)


Expand All @@ -217,7 +217,7 @@ def __init__(
alpha_x=alpha_x,
alpha_y=alpha_y,
alpha_z=alpha_z,
**kwargs
**kwargs,
)


Expand Down
4 changes: 2 additions & 2 deletions simpeg/utils/plot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def hillshade(array, azimuth, angle_altitude):
Y,
hillshade(DATA, shade_azimuth, shade_angle_altitude),
shade_ncontour,
**shadeOpts
**shadeOpts,
)

if dataloc:
Expand All @@ -279,7 +279,7 @@ def plot_1d_layer_model(
plot_elevation=False,
show_layers=False,
vlim=None,
**kwargs
**kwargs,
):
"""
Plot the vertical profile for a 1D layered Earth model.
Expand Down
2 changes: 1 addition & 1 deletion tests/base/test_Props.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def __init__(
AMap=None,
gamma=4.74,
gammaMap=None,
**kwargs
**kwargs,
):
super().__init__(**kwargs)
self.Ks = Ks
Expand Down
2 changes: 1 addition & 1 deletion tests/pf/test_forward_PFproblem.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_ana_forward(self):
*self.sphere_center,
self.chiblk,
self.b0,
"secondary"
"secondary",
)

n_obs, n_comp = self.rxLoc.shape[0], len(self.survey.components)
Expand Down
Loading

0 comments on commit 346a6fe

Please sign in to comment.