Skip to content

Commit 93e82fd

Browse files
Merge pull request #746 from jarrodmillman/ruff-recommendations
Update ruff
2 parents 42d2928 + 325b61e commit 93e82fd

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

.git-blame-ignore-revs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ bb473f6ff4a23e4fd5205eacdef713db15decadf
44
7cb7b365c51ab20d92745e5eefb95690e3ba2e14
55
67c4efab4e3ec1dc16c18b9ab8c5cd5f375040e0
66
8d00b416689c428b2bafdaad61ed3ec660ca06c2
7+
d6b447cab8c40aa47dc675a0f4349ae254e8b3ce

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ repos:
2626
args: [--prose-wrap=preserve]
2727

2828
- repo: https://github.com/MarcoGorelli/cython-lint
29-
rev: 582556b052c898dc484a981bea48de3284a4b8ee # frozen: v0.16.0
29+
rev: 9247866fce7128f2c0eaf4a09f437880397d4689 # frozen: v0.16.2
3030
hooks:
3131
- id: cython-lint
3232
args: [--no-pycodestyle, --max-line-length=88]
3333

3434
- repo: https://github.com/astral-sh/ruff-pre-commit
35-
rev: c0bff48397a5119af3fadb07c507dd09ac9e2aa8 # frozen: v0.3.6
35+
rev: f8a3f8c471fb698229face5ed7640a64900b781e # frozen: v0.4.4
3636
hooks:
3737
- id: ruff
38-
args: [--fix, --exit-non-zero-on-fix]
38+
args: ["--fix", "--show-fixes", "--exit-non-zero-on-fix"]
3939
- id: ruff-format
4040

4141
- repo: https://github.com/codespell-project/codespell

advanced/mathematical_optimization/examples/plot_gradient_descent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
def super_fmt(value):
3333
if value > 1:
3434
if np.abs(int(value) - value) < 0.1:
35-
out = "$10^{%.1i}$" % value
35+
out = f"$10^{{{int(value):d}}}$"
3636
else:
37-
out = "$10^{%.1f}$" % value
37+
out = f"$10^{{{value:.1f}}}$"
3838
else:
3939
value = np.exp(value - 0.01)
4040
if value > 0.1:

intro/scipy/summary-exercises/examples/plot_cumulative_wind_speed_prediction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
plt.plot(sorted_max_speeds, cprob, "o")
2727
plt.plot(fitted_max_speeds, nprob, "g--")
2828
plt.plot([fifty_wind], [fifty_prob], "o", ms=8.0, mfc="y", mec="y")
29-
plt.text(30, 0.05, r"$V_{50} = %.2f \, m/s$" % fifty_wind)
29+
plt.text(30, 0.05, rf"$V_{{50}} = {fifty_wind:.2f} \, m/s$")
3030
plt.plot([fifty_wind, fifty_wind], [plt.axis()[2], fifty_prob], "k--")
3131
plt.xlabel("Annual wind speed maxima [$m/s$]")
3232
plt.ylabel("Cumulative probability")

intro/scipy/summary-exercises/examples/plot_gumbell_wind_speed_prediction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def gumbell_dist(arr):
3333
plt.plot(fitted_max_speeds, nprob, "g--")
3434
plt.plot([fifty_wind], [fifty_prob], "o", ms=8.0, mfc="y", mec="y")
3535
plt.plot([fifty_wind, fifty_wind], [plt.axis()[2], fifty_prob], "k--")
36-
plt.text(35, -1, r"$V_{50} = %.2f \, m/s$" % fifty_wind)
36+
plt.text(35, -1, rf"$V_{{50}} = {fifty_wind:.2f} \, m/s$")
3737
plt.xlabel("Annual wind speed maxima [$m/s$]")
3838
plt.ylabel("Gumbell cumulative probability")
3939
plt.show()

0 commit comments

Comments
 (0)