Skip to content

Commit 4b1c43b

Browse files
dependabot[bot]dpaniciYigitElma
authored
Bump black from 24.10.0 to 26.3.1 in /devtools (#2169)
Bumps [black](https://github.com/psf/black) from 24.10.0 to 26.3.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/psf/black/releases">black's releases</a>.</em></p> <blockquote> <h2>26.3.1</h2> <h3>Stable style</h3> <ul> <li>Prevent Jupyter notebook magic masking collisions from corrupting cells by using exact-length placeholders for short magics and aborting if a placeholder can no longer be unmasked safely (<a href="https://redirect.github.com/psf/black/issues/5038">#5038</a>)</li> </ul> <h3>Configuration</h3> <ul> <li>Always hash cache filename components derived from <code>--python-cell-magics</code> so custom magic names cannot affect cache paths (<a href="https://redirect.github.com/psf/black/issues/5038">#5038</a>)</li> </ul> <h3><em>Blackd</em></h3> <ul> <li>Disable browser-originated requests by default, add configurable origin allowlisting and request body limits, and bound executor submissions to improve backpressure (<a href="https://redirect.github.com/psf/black/issues/5039">#5039</a>)</li> </ul> <h2>26.3.0</h2> <h3>Stable style</h3> <ul> <li>Don't double-decode input, causing non-UTF-8 files to be corrupted (<a href="https://redirect.github.com/psf/black/issues/4964">#4964</a>)</li> <li>Fix crash on standalone comment in lambda default arguments (<a href="https://redirect.github.com/psf/black/issues/4993">#4993</a>)</li> <li>Preserve parentheses when <code># type: ignore</code> comments would be merged with other comments on the same line, preventing AST equivalence failures (<a href="https://redirect.github.com/psf/black/issues/4888">#4888</a>)</li> </ul> <h3>Preview style</h3> <ul> <li>Fix bug where <code>if</code> guards in <code>case</code> blocks were incorrectly split when the pattern had a trailing comma (<a href="https://redirect.github.com/psf/black/issues/4884">#4884</a>)</li> <li>Fix <code>string_processing</code> crashing on unassigned long string literals with trailing commas (one-item tuples) (<a href="https://redirect.github.com/psf/black/issues/4929">#4929</a>)</li> <li>Simplify implementation of the power operator &quot;hugging&quot; logic (<a href="https://redirect.github.com/psf/black/issues/4918">#4918</a>)</li> </ul> <h3>Packaging</h3> <ul> <li>Fix shutdown errors in PyInstaller builds on macOS by disabling multiprocessing in frozen environments (<a href="https://redirect.github.com/psf/black/issues/4930">#4930</a>)</li> </ul> <h3>Performance</h3> <ul> <li>Introduce winloop for windows as an alternative to uvloop (<a href="https://redirect.github.com/psf/black/issues/4996">#4996</a>)</li> <li>Remove deprecated function <code>uvloop.install()</code> in favor of <code>uvloop.new_event_loop()</code> (<a href="https://redirect.github.com/psf/black/issues/4996">#4996</a>)</li> <li>Rename <code>maybe_install_uvloop</code> function to <code>maybe_use_uvloop</code> to simplify loop installation and creation of either a uvloop/winloop evenloop or default eventloop (<a href="https://redirect.github.com/psf/black/issues/4996">#4996</a>)</li> </ul> <h3>Output</h3> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/psf/black/blob/main/CHANGES.md">black's changelog</a>.</em></p> <blockquote> <h2>Version 26.3.1</h2> <h3>Stable style</h3> <ul> <li>Prevent Jupyter notebook magic masking collisions from corrupting cells by using exact-length placeholders for short magics and aborting if a placeholder can no longer be unmasked safely (<a href="https://redirect.github.com/psf/black/issues/5038">#5038</a>)</li> </ul> <h3>Configuration</h3> <ul> <li>Always hash cache filename components derived from <code>--python-cell-magics</code> so custom magic names cannot affect cache paths (<a href="https://redirect.github.com/psf/black/issues/5038">#5038</a>)</li> </ul> <h3><em>Blackd</em></h3> <ul> <li>Disable browser-originated requests by default, add configurable origin allowlisting and request body limits, and bound executor submissions to improve backpressure (<a href="https://redirect.github.com/psf/black/issues/5039">#5039</a>)</li> </ul> <h2>Version 26.3.0</h2> <h3>Stable style</h3> <ul> <li>Don't double-decode input, causing non-UTF-8 files to be corrupted (<a href="https://redirect.github.com/psf/black/issues/4964">#4964</a>)</li> <li>Fix crash on standalone comment in lambda default arguments (<a href="https://redirect.github.com/psf/black/issues/4993">#4993</a>)</li> <li>Preserve parentheses when <code># type: ignore</code> comments would be merged with other comments on the same line, preventing AST equivalence failures (<a href="https://redirect.github.com/psf/black/issues/4888">#4888</a>)</li> </ul> <h3>Preview style</h3> <ul> <li>Fix bug where <code>if</code> guards in <code>case</code> blocks were incorrectly split when the pattern had a trailing comma (<a href="https://redirect.github.com/psf/black/issues/4884">#4884</a>)</li> <li>Fix <code>string_processing</code> crashing on unassigned long string literals with trailing commas (one-item tuples) (<a href="https://redirect.github.com/psf/black/issues/4929">#4929</a>)</li> <li>Simplify implementation of the power operator &quot;hugging&quot; logic (<a href="https://redirect.github.com/psf/black/issues/4918">#4918</a>)</li> </ul> <h3>Packaging</h3> <ul> <li>Fix shutdown errors in PyInstaller builds on macOS by disabling multiprocessing in frozen environments (<a href="https://redirect.github.com/psf/black/issues/4930">#4930</a>)</li> </ul> <h3>Performance</h3> <ul> <li>Introduce winloop for windows as an alternative to uvloop (<a href="https://redirect.github.com/psf/black/issues/4996">#4996</a>)</li> <li>Remove deprecated function <code>uvloop.install()</code> in favor of <code>uvloop.new_event_loop()</code> (<a href="https://redirect.github.com/psf/black/issues/4996">#4996</a>)</li> <li>Rename <code>maybe_install_uvloop</code> function to <code>maybe_use_uvloop</code> to simplify loop installation and creation of either a uvloop/winloop eventloop or default eventloop (<a href="https://redirect.github.com/psf/black/issues/4996">#4996</a>)</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/psf/black/commit/c6755bb741b6481d6b3d3bb563c83fa060db96c9"><code>c6755bb</code></a> Prepare release 26.3.1 (<a href="https://redirect.github.com/psf/black/issues/5046">#5046</a>)</li> <li><a href="https://github.com/psf/black/commit/69973fd6950985fbeb1090d96da717dc4d8380b0"><code>69973fd</code></a> Harden blackd browser-facing request handling (<a href="https://redirect.github.com/psf/black/issues/5039">#5039</a>)</li> <li><a href="https://github.com/psf/black/commit/4937fe6cf241139ddbfc16b0bdbb5b422798909d"><code>4937fe6</code></a> Fix some shenanigans with the cache file and IPython (<a href="https://redirect.github.com/psf/black/issues/5038">#5038</a>)</li> <li><a href="https://github.com/psf/black/commit/2e641d174469c505d5ae905e75d4c769597e681f"><code>2e641d1</code></a> docs: remove outdated Black Playground references (<a href="https://redirect.github.com/psf/black/issues/5044">#5044</a>)</li> <li><a href="https://github.com/psf/black/commit/c014b22a2d5e0632587b47b81151658bddfa0b88"><code>c014b22</code></a> Remove unused internal code (<a href="https://redirect.github.com/psf/black/issues/5041">#5041</a>)</li> <li><a href="https://github.com/psf/black/commit/0dae20b2d009f2f03de8696d06b0c947d3abafc9"><code>0dae20b</code></a> Add new changelog (<a href="https://redirect.github.com/psf/black/issues/5036">#5036</a>)</li> <li><a href="https://github.com/psf/black/commit/c5c1cbddd92cecb554ac2a77a24139dd76831030"><code>c5c1cbd</code></a> Minor release patches (<a href="https://redirect.github.com/psf/black/issues/5035">#5035</a>)</li> <li><a href="https://github.com/psf/black/commit/7e5a828c37d71b6a6666e28eed444816def6a8f4"><code>7e5a828</code></a> docs: clarify relationship between Black style and PEP 8 (<a href="https://redirect.github.com/psf/black/issues/5025">#5025</a>)</li> <li><a href="https://github.com/psf/black/commit/69705deb8776e7c5e585668da106d1abe2cb8d77"><code>69705de</code></a> docs: add clearer pyproject configuration guidance (<a href="https://redirect.github.com/psf/black/issues/5026">#5026</a>)</li> <li><a href="https://github.com/psf/black/commit/35ea67920b7f6ac8e09be1c47278752b1e827f76"><code>35ea679</code></a> Prepare release 26.3.0 (<a href="https://redirect.github.com/psf/black/issues/5032">#5032</a>)</li> <li>Additional commits viewable in <a href="https://github.com/psf/black/compare/24.10.0...26.3.1">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=black&package-manager=pip&previous-version=24.10.0&new-version=26.3.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/PlasmaControl/DESC/network/alerts). </details> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dario Panici <dpanici@princeton.edu> Co-authored-by: Dario Panici <37969854+dpanici@users.noreply.github.com> Co-authored-by: YigitElma <yigitelmacioglu@gmail.com>
1 parent 7238bea commit 4b1c43b

10 files changed

Lines changed: 18 additions & 23 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: 24.10.0
3+
rev: 26.3.1
44
hooks:
55
- id: black-jupyter
66
log_file: devtools/pre-commit.log

desc/basis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2012,8 +2012,8 @@ def _jacobi_body_fun(kk, d_p_a_b_x):
20122012

20132013
@_jacobi.defjvp
20142014
def _jacobi_jvp(dx, x, xdot):
2015-
(n, alpha, beta, x) = x
2016-
(*_, xdot) = xdot
2015+
n, alpha, beta, x = x
2016+
*_, xdot = xdot
20172017
f = _jacobi(n, alpha, beta, x, dx)
20182018
df = _jacobi(n, alpha, beta, x, dx + 1)
20192019
# in theory n, alpha, beta, dx aren't differentiable (they're integers)

desc/examples/regenerate_all_equilibria.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
python3 regenerate_all_equilibria.py
66
77
"""
8+
89
import argparse
910
import glob
1011
import os

desc/objectives/_neoclassical.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
from .objective_funs import _Objective, collect_docs
1313
from .utils import _parse_callable_target_bounds
1414

15-
_bounce_overwrite = {
16-
"deriv_mode": """
15+
_bounce_overwrite = {"deriv_mode": """
1716
deriv_mode : {"auto", "fwd", "rev"}
1817
Specify how to compute Jacobian matrix, either forward mode or reverse mode AD.
1918
``auto`` selects forward or reverse mode based on the size of the input and
@@ -24,8 +23,7 @@
2423
In ``rev`` mode, reducing the value of the parameter ``pitch_batch_size`` does
2524
not reduce memory consumption, so it is recommended to retain the default unless
2625
you have explicitly requested to use ``fwd`` mode.
27-
"""
28-
}
26+
"""}
2927

3028

3129
class EffectiveRipple(_Objective):

desc/optimize/_constraint_wrappers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ def _set_eq_state_vector(self):
639639
for arg in ["R_lmn", "Z_lmn", "L_lmn", "Ra_n", "Za_n"]:
640640
self._args.remove(arg)
641641

642-
(self._eq_Z, self._eq_D, self._eq_unfixed_idx) = (
642+
self._eq_Z, self._eq_D, self._eq_unfixed_idx = (
643643
self._eq_solve_objective._Z,
644644
self._eq_solve_objective._D,
645645
self._eq_solve_objective._unfixed_idx,

desc/optimize/optimizer.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -586,17 +586,13 @@ def _maybe_wrap_nonlinear_constraints(
586586
)
587587
return objective, nonlinear_constraints
588588
if wrapper is None and not optimizers[method]["equality_constraints"]:
589-
warnings.warn(
590-
FutureWarning(
591-
f"""
589+
warnings.warn(FutureWarning(f"""
592590
Nonlinear constraints detected but method {method} does not support
593591
nonlinear constraints. Defaulting to method "proximal-{method}"
594592
In the future this will raise an error. To ignore this warning, specify
595593
a wrapper "proximal-" to convert the nonlinearly constrained problem
596594
into an unconstrained one.
597-
"""
598-
)
599-
)
595+
"""))
600596
wrapper = "proximal"
601597
if wrapper is not None and wrapper.lower() in ["prox", "proximal"]:
602598
perturb_options = options.pop("perturb_options", {})

desc/vmec.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ def save( # noqa: C901
790790
idx = np.where(eq.R_basis.modes[:, 1] == 0)[0]
791791
R0_n = np.zeros((2 * N + 1,))
792792
for k in idx:
793-
(l, m, n) = eq.R_basis.modes[k, :]
793+
l, m, n = eq.R_basis.modes[k, :]
794794
R0_n[n + N] += (-2 * (l // 2 % 2) + 1) * eq.R_lmn[k]
795795
raxis_cc = file.createVariable("raxis_cc", np.float64, ("n_tor",))
796796
raxis_cc.long_name = "cos(n*p) component of magnetic axis R coordinate"
@@ -807,7 +807,7 @@ def save( # noqa: C901
807807
idx = np.where(eq.Z_basis.modes[:, 1] == 0)[0]
808808
Z0_n = np.zeros((2 * N + 1,))
809809
for k in idx:
810-
(l, m, n) = eq.Z_basis.modes[k, :]
810+
l, m, n = eq.Z_basis.modes[k, :]
811811
Z0_n[n + N] += (-2 * (l // 2 % 2) + 1) * eq.Z_lmn[k]
812812
zaxis_cs = file.createVariable("zaxis_cs", np.float64, ("n_tor",))
813813
zaxis_cs.long_name = "sin(n*p) component of magnetic axis Z coordinate"
@@ -1600,13 +1600,13 @@ def write_vmec_input(cls, eq, fname, header=None, **kwargs): # noqa: C901
16001600
idx = np.where(eq.R_basis.modes[:, 1] == 0)[0]
16011601
R0_n = np.zeros((2 * eq.N + 1,))
16021602
for k in idx:
1603-
(l, m, n) = eq.R_basis.modes[k, :]
1603+
l, m, n = eq.R_basis.modes[k, :]
16041604
R0_n[n + eq.N] += (-2 * (l // 2 % 2) + 1) * eq.R_lmn[k]
16051605
# Z axis
16061606
idx = np.where(eq.Z_basis.modes[:, 1] == 0)[0]
16071607
Z0_n = np.zeros((2 * eq.N + 1,))
16081608
for k in idx:
1609-
(l, m, n) = eq.Z_basis.modes[k, :]
1609+
l, m, n = eq.Z_basis.modes[k, :]
16101610
Z0_n[n + eq.N] += (-2 * (l // 2 % 2) + 1) * eq.Z_lmn[k]
16111611
# R axis cosine coefficients
16121612
f.write(" RAXIS_CC = ")

devtools/dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ sphinx-design
1919

2020

2121
# linting
22-
black[jupyter] == 24.10.0
22+
black[jupyter] == 26.3.1
2323
flake8 ~= 7.3
2424
flake8-docstrings >= 1.0.0, <= 1.7.0
2525
flake8-eradicate >= 1.0.0, <= 1.5.0

tests/test_examples.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,7 +1605,7 @@ def test_regcoil_windowpane_check_B(regcoil_windowpane_coils):
16051605
@pytest.mark.slow
16061606
def test_regcoil_PF_check_B(regcoil_PF_coils):
16071607
"""Test precise QA PF (helicity=(0,2)) regcoil solution."""
1608-
(data, surface_current_field, eq) = regcoil_PF_coils
1608+
data, surface_current_field, eq = regcoil_PF_coils
16091609
assert surface_current_field.G == 0
16101610
assert abs(surface_current_field.I) > 0
16111611
chi_B = data["chi^2_B"][0]
@@ -1629,7 +1629,7 @@ def test_regcoil_helical_coils_check_objective_method(
16291629
regcoil_helical_coils_scan,
16301630
):
16311631
"""Test precise QA helical coil regcoil solution."""
1632-
(data, initial_surface_current_field, eq) = regcoil_helical_coils_scan
1632+
data, initial_surface_current_field, eq = regcoil_helical_coils_scan
16331633
lam_index = 1
16341634
lam = data["lambda_regularization"][lam_index]
16351635
initial_surface_current_field.Phi_mn = data["Phi_mn"][lam_index]

tests/test_surfaces.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def test_constant_offset_surface_circle(self):
151151
s = FourierRZToroidalSurface()
152152
grid = LinearGrid(M=3, N=2)
153153
offset = 1
154-
(s_offset, data, _) = s.constant_offset_surface(
154+
s_offset, data, _ = s.constant_offset_surface(
155155
offset, grid, M=1, N=1, full_output=True
156156
)
157157
r_offset_surf = data["x_offset_surface"]
@@ -260,7 +260,7 @@ def test_constant_offset_surface_rot_ellipse(self):
260260
s = eq.surface
261261
s.change_resolution(M=2, N=2)
262262
offset = 0.1
263-
(s_offset, data, _) = s.constant_offset_surface(
263+
s_offset, data, _ = s.constant_offset_surface(
264264
offset, grid=None, M=2, N=2, full_output=True
265265
)
266266
r_offset_surf = data["x_offset_surface"]

0 commit comments

Comments
 (0)