Skip to content

Commit

Permalink
Merge pull request pymc-labs#274 from jsakv/update-makefile
Browse files Browse the repository at this point in the history
Replace makefile commands with ruff
  • Loading branch information
drbenvincent committed Nov 24, 2023
2 parents 2169bf0 + 4337625 commit 83cb28c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ init:

lint:
pip install causalpy[lint]
isort .
black .
ruff check --fix .
ruff format .

check_lint:
pip install causalpy[lint]
flake8 .
isort --check-only .
black --diff --check --fast .
ruff check .
ruff format --diff --check .
nbqa black --check .
nbqa isort --check-only .
nbqa ruff .
interrogate .

doctest:
Expand Down
5 changes: 1 addition & 4 deletions causalpy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import arviz as az

from causalpy import pymc_experiments
from causalpy import pymc_models
from causalpy import skl_experiments
from causalpy import skl_models
from causalpy import pymc_experiments, pymc_models, skl_experiments, skl_models
from causalpy.version import __version__

from .data import load_data
Expand Down
4 changes: 2 additions & 2 deletions causalpy/pymc_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""

import warnings
import warnings # noqa: I001
from typing import Union

import arviz as az
Expand All @@ -23,7 +23,7 @@
from patsy import build_design_matrices, dmatrices
from sklearn.linear_model import LinearRegression as sk_lin_reg

from causalpy.custom_exceptions import BadIndexException # NOQA
from causalpy.custom_exceptions import BadIndexException
from causalpy.custom_exceptions import DataException, FormulaException
from causalpy.plot_utils import plot_xY
from causalpy.utils import _is_variable_dummy_coded
Expand Down
4 changes: 2 additions & 2 deletions causalpy/tests/test_input_validation.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""Input validation tests"""

import numpy as np
import numpy as np # noqa: I001
import pandas as pd
import pytest

import causalpy as cp
from causalpy.custom_exceptions import BadIndexException # NOQA
from causalpy.custom_exceptions import BadIndexException
from causalpy.custom_exceptions import DataException, FormulaException

sample_kwargs = {"tune": 20, "draws": 20, "chains": 2, "cores": 2}
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,8 @@ color = true
omit-covered-files = false
generate-badge = "docs/source/_static/"
badge-format = "svg"

[tool.ruff.lint]
extend-select = [
"I", # isort
]

0 comments on commit 83cb28c

Please sign in to comment.