Skip to content

Commit fb9262b

Browse files
committed
get ruff format pre commit working (hopefully)
1 parent c69c002 commit fb9262b

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

causalpy/pymc_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def print_row(
164164
) -> None:
165165
"""Print one row of the coefficient table"""
166166
formatted_name = f" {name: <{max_label_length}}"
167-
formatted_val = f"{round_num(coeff_samples.mean().data, round_to)}, 94% HDI [{round_num(coeff_samples.quantile(0.03).data, round_to)}, {round_num(coeff_samples.quantile(1-0.03).data, round_to)}]" # noqa: E501
167+
formatted_val = f"{round_num(coeff_samples.mean().data, round_to)}, 94% HDI [{round_num(coeff_samples.quantile(0.03).data, round_to)}, {round_num(coeff_samples.quantile(1 - 0.03).data, round_to)}]" # noqa: E501
168168
print(f" {formatted_name} {formatted_val}")
169169

170170
print("Model coefficients:")

causalpy/tests/test_api_stability.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ def test_causal_inference_and_discovery_with_python_example():
3636

3737
# Build the model
3838
model = cp.pymc_models.WeightedSumFitter(sample_kwargs=sample_kwargs)
39-
assert isinstance(
40-
model, WeightedSumFitter
41-
), "model is not an instance of WeightedSumFitter"
39+
assert isinstance(model, WeightedSumFitter), (
40+
"model is not an instance of WeightedSumFitter"
41+
)
4242

4343
formula = "twitter ~ 0 + tiktok + linkedin + instagram"
4444

@@ -49,9 +49,9 @@ def test_causal_inference_and_discovery_with_python_example():
4949
formula=formula,
5050
model=model,
5151
)
52-
assert isinstance(
53-
results, SyntheticControl
54-
), "results is not an instance of SyntheticControl"
52+
assert isinstance(results, SyntheticControl), (
53+
"results is not an instance of SyntheticControl"
54+
)
5555

5656
fig, ax = results.plot()
5757
assert isinstance(fig, plt.Figure)

docs/source/notebooks/multi_cell_geolift.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,7 @@
10991099
"unpooled_results = []\n",
11001100
"\n",
11011101
"for i, target_geo in enumerate(treated):\n",
1102-
" print(f\"Analyzing test geo: {target_geo} ({i+1} of {len(treated)})\")\n",
1102+
" print(f\"Analyzing test geo: {target_geo} ({i + 1} of {len(treated)})\")\n",
11031103
" formula = f\"{target_geo} ~ 0 + {' + '.join(untreated)}\"\n",
11041104
" print(formula)\n",
11051105
"\n",

docs/source/notebooks/rkink_pymc.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
" beta = rng.random(5)\n",
109109
" ax[0, col].plot(x, f(x, beta, kink), lw=3)\n",
110110
" ax[1, col].plot(x, np.gradient(f(x, beta, kink), x), lw=3)\n",
111-
" ax[0, col].set(title=f\"Random {col+1}\")\n",
111+
" ax[0, col].set(title=f\"Random {col + 1}\")\n",
112112
" ax[1, col].set(xlabel=\"x\")\n",
113113
"\n",
114114
"ax[0, 0].set(ylabel=\"$y = f(x)$\")\n",

0 commit comments

Comments
 (0)