Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Ruff #484

Merged
merged 1 commit into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pymc_marketing/mmm/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def plot_posterior_predictive(
y2=likelihood_hdi_94[:, 1],
color="C0",
alpha=0.2,
label="$94\%$ HDI",
label="$94\%$ HDI", # noqa: W605
)

ax.fill_between(
Expand All @@ -333,7 +333,7 @@ def plot_posterior_predictive(
y2=likelihood_hdi_50[:, 1],
color="C0",
alpha=0.3,
label="$50\%$ HDI",
label="$50\%$ HDI", # noqa: W605
)

target_to_plot: np.ndarray = np.asarray(
Expand Down Expand Up @@ -406,7 +406,7 @@ def plot_components_contributions(self, **plt_kwargs: Any) -> plt.Figure:
y2=hdi.isel(hdi=1),
color=f"C{i}",
alpha=0.25,
label=f"$94\%$ HDI ({var_contribution})",
label=f"$94\%$ HDI ({var_contribution})", # noqa: W605
)
ax.plot(
np.asarray(self.X[self.date_column]),
Expand All @@ -433,7 +433,7 @@ def plot_components_contributions(self, **plt_kwargs: Any) -> plt.Figure:
y2=intercept_hdi[:, 1],
color=f"C{i + 1}",
alpha=0.25,
label="$94\%$ HDI (intercept)",
label="$94\%$ HDI (intercept)", # noqa: W605
)
ax.plot(
np.asarray(self.X[self.date_column]),
Expand Down
2 changes: 1 addition & 1 deletion pymc_marketing/mmm/delayed_saturated_mmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ def plot_channel_contributions_grid(
y1=hdi_contribution[:, 0],
y2=hdi_contribution[:, 1],
color=f"C{i}",
label=f"{channel} $94\%$ HDI contribution",
label=f"{channel} $94\%$ HDI contribution", # noqa: W605
alpha=0.4,
)

Expand Down
2 changes: 1 addition & 1 deletion pymc_marketing/mmm/transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def logistic_saturation(x, lam: Union[npt.NDArray[np.float_], float] = 0.5):
-------
tensor
Transformed tensor.
"""
""" # noqa: W605
return (1 - pt.exp(-lam * x)) / (1 + pt.exp(-lam * x))


Expand Down
12 changes: 5 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@ docs = [
"sphinx-notfound-page",
"sphinx-design",
]
lint = [
"mypy",
"pandas-stubs",
"pre-commit>=2.19.0",
"ruff>=0.1.4",
]
lint = ["mypy", "pandas-stubs", "pre-commit>=2.19.0", "ruff>=0.1.4"]
test = ["lifetimes==0.11.3", "pytest==7.0.1", "pytest-cov==3.0.0"]

[tool.setuptools]
Expand All @@ -64,7 +59,10 @@ repository = "https://github.com/pymc-labs/pymc-marketing"
#changelog = ""

[tool.ruff.lint]
select = ["E4", "E7", "E9", "F", "I"]
select = ["E", "F", "I", "W"]
ignore = [
"E501", # Line too long
]

[tool.pytest.ini_options]
addopts = [
Expand Down