Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 17, 2024
1 parent c40a495 commit 579a9e0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions tests/boilercore_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ def _filter_certain_warnings():
filter_boiler_warnings()


@pytest.fixture()
@pytest.fixture
def project_session_path(tmp_path_factory) -> Path:
"""Project session path."""
return get_session_path(tmp_path_factory, boilercore)


@pytest.fixture()
@pytest.fixture
def params(project_session_path):
"""Parameters."""
return Params(source=project_session_path / "params.yaml")
Expand All @@ -47,7 +47,7 @@ def cache_dir(project_session_path) -> Path:
return cache_directory


@pytest.fixture()
@pytest.fixture
def cached_function_and_cache_file(
request, project_session_path
) -> Iterator[tuple[Callable[..., Any], Path]]:
Expand Down Expand Up @@ -76,11 +76,11 @@ def fun(
(cache_dir / cache_filename).unlink(missing_ok=True)


@pytest.fixture()
@pytest.fixture
def cached_function(cached_function_and_cache_file): # noqa: D103
return cached_function_and_cache_file[0]


@pytest.fixture()
@pytest.fixture
def cache_file(cached_function_and_cache_file): # noqa: D103
return cached_function_and_cache_file[1]
6 changes: 3 additions & 3 deletions tests/boilercore_tests/modelfun/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
MODELFUN = Path("src/boilercore/stages/modelfun.ipynb").resolve()


@pytest.fixture()
@pytest.fixture
def ns(request) -> SimpleNamespace:
"""Namespace for the model function notebook."""
return get_nb_ns(MODELFUN.read_text(encoding="utf-8"))


@pytest.fixture()
@pytest.fixture
def model(params):
"""Deserialized model."""
return FIT.get_models(params.paths.models)[1]


@pytest.fixture()
@pytest.fixture
def plt(plt):
"""Plot."""
sns.set_theme(
Expand Down
10 changes: 5 additions & 5 deletions tests/boilercore_tests/modelfun/test_modelfun.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_syms(group_name: str):
assert all(var == sym.name for var, sym in symvars.items())


@pytest.mark.slow()
@pytest.mark.slow
def test_forward_model(model):
"""Test that the model evaluates to the expected output for known input."""
# fmt: off
Expand All @@ -54,7 +54,7 @@ def test_forward_model(model):


# TODO: Add `nan` failed fit check
@pytest.mark.slow()
@pytest.mark.slow
@pytest.mark.usefixtures("plt")
@pytest.mark.parametrize(
("run", "y", "expected"),
Expand Down Expand Up @@ -95,7 +95,7 @@ def test_model_fit(params, model, run, y, expected):
assert result == approx(expected)


@pytest.mark.slow()
@pytest.mark.slow
def test_ode(ns):
"""Verify the solution to the ODE by substitution."""
# Don't subs/simplify the lhs then try equating to zero. Doesn't work. "Truth value of
Expand All @@ -104,14 +104,14 @@ def test_ode(ns):
assert ode.subs(T(x), T_int_expr).simplify()


@pytest.mark.slow()
@pytest.mark.slow
def test_temperature_continuous(ns):
"""Test that temperature is continuous at the domain transition."""
T_wa_expr_w, T_wa_expr_a = ns.T_wa_expr_w, ns.T_wa_expr_a # noqa: N806
assert Eq(T_wa_expr_w, T_wa_expr_a).simplify()


@pytest.mark.slow()
@pytest.mark.slow
def test_temperature_gradient_continuous(ns):
"""Test that the temperature gradient is continuous at the domain transition."""
q_wa_expr_w, q_wa_expr_a = ns.q_wa_expr_w, ns.q_wa_expr_a
Expand Down

0 comments on commit 579a9e0

Please sign in to comment.