From 2ac1ecfe02e32810b95b3238a8580488acad8fcc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 10:25:18 +0200 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#159) * [pre-commit.ci] pre-commit autoupdate * Manual update * Run updated hooks. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Hans-Martin von Gaudecker --- .pre-commit-config.yaml | 4 ++-- documents/task_documents.py | 1 + tests/analysis/test_model.py | 3 ++- tests/analysis/test_predict.py | 5 +++-- tests/data_management/test_stats4schools_smoking.py | 3 ++- tests/test_template.py | 1 + 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0ecd0e09..b7d217d6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: yamllint - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.3 + rev: v0.6.1 hooks: # Run the linter. - id: ruff @@ -75,7 +75,7 @@ repos: # R specific hooks: https://github.com/lorenzwalthert/precommit - repo: https://github.com/lorenzwalthert/precommit - rev: v0.4.2 + rev: v0.4.3 hooks: - id: style-files args: [--style_pkg=styler, --style_fun=tidyverse_style] diff --git a/documents/task_documents.py b/documents/task_documents.py index d7244551..50810b68 100644 --- a/documents/task_documents.py +++ b/documents/task_documents.py @@ -4,6 +4,7 @@ import pytask from pytask_latex import compilation_steps as cs + from template_project.config import BLD, DOCUMENTS, ROOT documents = ["paper", "presentation"] diff --git a/tests/analysis/test_model.py b/tests/analysis/test_model.py index b5e1d168..fdfe0df6 100644 --- a/tests/analysis/test_model.py +++ b/tests/analysis/test_model.py @@ -3,12 +3,13 @@ import numpy as np import pandas as pd import pytest + from template_project.analysis.model_template import fit_logit_model DESIRED_PRECISION = 10e-2 -@pytest.fixture() +@pytest.fixture def data(): rng = np.random.default_rng(seed=0) x = rng.normal(size=100_000) diff --git a/tests/analysis/test_predict.py b/tests/analysis/test_predict.py index 3c2083e3..20c47018 100644 --- a/tests/analysis/test_predict.py +++ b/tests/analysis/test_predict.py @@ -3,10 +3,11 @@ import pandas as pd import pytest from pandas.testing import assert_frame_equal + from template_project.analysis.predict_template import predict_prob_by_age -@pytest.fixture() +@pytest.fixture def data(): out = pd.DataFrame([1, 2, 3], columns=["age"]) out["education"] = ["high-school", "high-school", "university"] @@ -14,7 +15,7 @@ def data(): return out -@pytest.fixture() +@pytest.fixture def model(): class ModelClass: @staticmethod diff --git a/tests/data_management/test_stats4schools_smoking.py b/tests/data_management/test_stats4schools_smoking.py index 48b6bdb1..36db7d81 100644 --- a/tests/data_management/test_stats4schools_smoking.py +++ b/tests/data_management/test_stats4schools_smoking.py @@ -2,6 +2,7 @@ import pandas as pd import pytest from pandas.testing import assert_series_equal + from template_project.data_management.stats4schools_smoking_template import ( _clean_current_smoker, _clean_gender, @@ -15,7 +16,7 @@ def assert_categorical_equal(left, right): assert_series_equal(pd.Series(left), pd.Series(right)) -@pytest.fixture() +@pytest.fixture def data(): data = { "highest_qualification": [ diff --git a/tests/test_template.py b/tests/test_template.py index f5e12ae1..85f4cee7 100644 --- a/tests/test_template.py +++ b/tests/test_template.py @@ -1,5 +1,6 @@ import pytask from _pytask.outcomes import ExitCode + from template_project import config from template_project.config import ROOT