Skip to content

Commit

Permalink
style: pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] authored and mdtanker committed Oct 9, 2024
1 parent 5c0cfdf commit 28687c5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/invert4geom/cross_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,13 +540,13 @@ def zref_density_optimal_parameter(
raise ValueError(msg)

if zref_values is None:
zref = kwargs.get("zref", None)
zref = kwargs.get("zref")
if zref is None:
msg = "must provide zref_values or zref in kwargs"
raise ValueError(msg)
zref_values = [zref]
elif density_contrast_values is None:
density_contrast = kwargs.get("density_contrast", None)
density_contrast = kwargs.get("density_contrast")
if density_contrast is None:
msg = "must provide density_contrast_values or density_contrast in kwargs"
raise ValueError(msg)
Expand Down
8 changes: 4 additions & 4 deletions src/invert4geom/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ def show_prism_layers(
notebook=True,
)

opacity = kwargs.get("opacity", None)
opacity = kwargs.get("opacity")

if isinstance(prisms, xr.Dataset):
prisms = [prisms]
Expand All @@ -1126,7 +1126,7 @@ def show_prism_layers(
style=kwargs.get("style", "surface"),
show_edges=kwargs.get("show_edges", False),
opacity=trans,
scalar_bar_args=kwargs.get("scalar_bar_args", None),
scalar_bar_args=kwargs.get("scalar_bar_args"),
)
else:
plotter.add_mesh(
Expand All @@ -1139,7 +1139,7 @@ def show_prism_layers(
show_edges=kwargs.get("show_edges", False),
log_scale=kwargs.get("log_scale", True),
opacity=trans,
scalar_bar_args=kwargs.get("scalar_bar_args", None),
scalar_bar_args=kwargs.get("scalar_bar_args"),
)
plotter.set_scale(
zscale=kwargs.get("zscale", 75)
Expand Down Expand Up @@ -1336,7 +1336,7 @@ def plot_stochastic_results(
unit = kwargs.get("unit", "m")
reverse_cpt = kwargs.get("reverse_cpt", True)
label = kwargs.get("label", "ensemble mean")
points_label = kwargs.get("points_label", None)
points_label = kwargs.get("points_label")
fig_height = kwargs.get("fig_height", 12)

try:
Expand Down
12 changes: 6 additions & 6 deletions tests/test_inversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def dummy_jacobian_square() -> NDArray:
################


@pytest.mark.use_numba()
@pytest.mark.use_numba
def test_grav_column_der_relative_values():
"""
test the grav_column_der function
Expand Down Expand Up @@ -275,7 +275,7 @@ def test_grav_column_der_relative_values():
assert h < a


@pytest.mark.use_numba()
@pytest.mark.use_numba
def test_grav_column_der():
"""
test the grav_column_der function against a small prism approximation
Expand Down Expand Up @@ -306,7 +306,7 @@ def test_grav_column_der():
assert dg_z == pytest.approx(hm_dg_z, rel=1e-2)


@pytest.mark.use_numba()
@pytest.mark.use_numba
def test_jacobian_annular():
"""
test the jacobian_annular function
Expand Down Expand Up @@ -359,7 +359,7 @@ def test_prism_properties_error():
inversion._prism_properties(prisms_layer, method="wrong_input")


@pytest.mark.use_numba()
@pytest.mark.use_numba
def test_jacobian_prism():
"""
test the jacobian_prism function
Expand All @@ -385,7 +385,7 @@ def test_jacobian_prism():
assert jac[:, 0:-3].min() > 0


@pytest.mark.use_numba()
@pytest.mark.use_numba
def test_jacobian():
"""
test the jacobian dispatcher function
Expand Down Expand Up @@ -470,7 +470,7 @@ def test_solver_square_error():
]


@pytest.mark.use_numba()
@pytest.mark.use_numba
@pytest.mark.parametrize("solver_type", solver_types)
def test_solver_square(solver_type):
"""
Expand Down

0 comments on commit 28687c5

Please sign in to comment.