diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index eec5b28..0a0d5f8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -46,7 +46,7 @@ repos: # Ruff, the Python auto-correcting linter/formatter written in Rust - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.7 + rev: v0.6.1 hooks: - id: ruff args: ["--fix", "--show-fixes"] diff --git a/notebooks/acro_demo.ipynb b/notebooks/acro_demo.ipynb index 1e01621..f2ab1ae 100644 --- a/notebooks/acro_demo.ipynb +++ b/notebooks/acro_demo.ipynb @@ -14,9 +14,8 @@ "outputs": [], "source": [ "import os\n", - "import sys\n", - "import pandas as pd\n", - "import numpy as np" + "\n", + "import pandas as pd" ] }, { @@ -36,7 +35,7 @@ "metadata": {}, "outputs": [], "source": [ - "from acro import ACRO, add_constant, add_to_acro" + "from acro import ACRO" ] }, { diff --git a/notebooks/acro_demo_v2.ipynb b/notebooks/acro_demo_v2.ipynb index ff217a0..4ebc722 100644 --- a/notebooks/acro_demo_v2.ipynb +++ b/notebooks/acro_demo_v2.ipynb @@ -14,9 +14,9 @@ "outputs": [], "source": [ "import os\n", - "import sys\n", - "import pandas as pd\n", - "import numpy as np" + "\n", + "import numpy as np\n", + "import pandas as pd" ] }, { @@ -36,7 +36,7 @@ "metadata": {}, "outputs": [], "source": [ - "from acro import ACRO, add_constant, add_to_acro" + "from acro import ACRO" ] }, { diff --git a/notebooks/test-nursery.ipynb b/notebooks/test-nursery.ipynb index d0b9bdc..98399f2 100644 --- a/notebooks/test-nursery.ipynb +++ b/notebooks/test-nursery.ipynb @@ -24,9 +24,9 @@ "outputs": [], "source": [ "import os\n", - "import sys\n", - "import pandas as pd\n", - "import numpy as np" + "\n", + "import numpy as np\n", + "import pandas as pd" ] }, { diff --git a/notebooks/test.ipynb b/notebooks/test.ipynb index 40b59b9..6317584 100644 --- a/notebooks/test.ipynb +++ b/notebooks/test.ipynb @@ -19,8 +19,9 @@ "source": [ "import os\n", "import sys\n", - "import pandas as pd\n", - "import numpy as np" + "\n", + "import numpy as np\n", + "import pandas as pd" ] }, { @@ -47,7 +48,7 @@ }, "outputs": [], "source": [ - "from acro import ACRO, acro_tables, add_constant, utils" + "from acro import ACRO, add_constant, utils" ] }, { diff --git a/pyproject.toml b/pyproject.toml index 2500cb2..e25d3de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,6 +45,7 @@ lint.select = [ exclude = [ "__init__.py", + "stata/*", ] lint.ignore = [ diff --git a/stata/test_stata_acro_ado.ipynb b/stata/test_stata_acro_ado.ipynb index 382a771..d9db91d 100644 --- a/stata/test_stata_acro_ado.ipynb +++ b/stata/test_stata_acro_ado.ipynb @@ -41,14 +41,14 @@ } ], "source": [ - "import acro\n", - "from acro import utils\n", - "from acro import stata_config\n", - "import pandas as pd\n", - "from acro import acro_stata_parser\n", "from importlib import reload\n", + "\n", + "import pandas as pd\n", "import pytest\n", "\n", + "import acro\n", + "from acro import acro_stata_parser, stata_config\n", + "\n", "reload(acro_stata_parser)" ] }, @@ -644,7 +644,7 @@ "outputs": [], "source": [ "def test_stata_exclusion_in_context(mydata):\n", - " \"\"\"tests that the subsetting code gets called properly from table handler\"\"\"\n", + " \"\"\"Tests that the subsetting code gets called properly from table handler\"\"\"\n", " # if condition\n", " correct1 = (\n", " \"------------------|\\n\"\n", diff --git a/test/test_initial.py b/test/test_initial.py index 55d75e9..7cbc2be 100644 --- a/test/test_initial.py +++ b/test/test_initial.py @@ -17,7 +17,7 @@ PATH: str = "RES_PYTEST" -@pytest.fixture() +@pytest.fixture def data() -> pd.DataFrame: """Load test data.""" path = os.path.join("data", "test_data.dta") @@ -25,7 +25,7 @@ def data() -> pd.DataFrame: return data -@pytest.fixture() +@pytest.fixture def acro() -> ACRO: """Initialise ACRO.""" return ACRO(suppress=True) diff --git a/test/test_stata17_interface.py b/test/test_stata17_interface.py index b75f6c8..729b196 100644 --- a/test/test_stata17_interface.py +++ b/test/test_stata17_interface.py @@ -25,7 +25,7 @@ # return ACRO() -@pytest.fixture() +@pytest.fixture def data() -> pd.DataFrame: """Load test data.""" path = os.path.join("data", "test_data.dta") diff --git a/test/test_stata_interface.py b/test/test_stata_interface.py index 9531dce..2cb80d4 100644 --- a/test/test_stata_interface.py +++ b/test/test_stata_interface.py @@ -26,7 +26,7 @@ # return ACRO() -@pytest.fixture() +@pytest.fixture def data() -> pd.DataFrame: """Load test data.""" path = os.path.join("data", "test_data.dta")