Skip to content

Commit 65c7dd3

Browse files
committed
ruff formatting
1 parent e4509f4 commit 65c7dd3

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

pyhdtoolkit/cpymadtools/constants.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116

117117
# ----- LHC Arc Correctors Knobs ----- #
118118
LHC_KQTF_KNOBS: list[str] = [ # tune trims, focusing and defocusing families, for each beam
119-
f"kqt{family}.a{sector}{sector+1 if sector < _MAX_SECTOR_VALUE else 1}.b{beam}"
119+
f"kqt{family}.a{sector}{sector + 1 if sector < _MAX_SECTOR_VALUE else 1}.b{beam}"
120120
for beam in [1, 2]
121121
for family in ["f", "d"]
122122
for sector in [1, 2, 3, 4, 5, 6, 7, 8]
@@ -131,34 +131,34 @@
131131
[f"kqs.a{sector}{sector+1 if sector < _MAX_SECTOR_VALUE else 1}b2" for sector in [1, 3, 5, 7]]
132132
# fmt: on
133133
LHC_KSF_KNOBS: list[str] = [ # sextupole correctors
134-
f"ks{family}{beam_id}.a{sector}{sector+1 if sector < _MAX_SECTOR_VALUE else 1}b{beam}"
134+
f"ks{family}{beam_id}.a{sector}{sector + 1 if sector < _MAX_SECTOR_VALUE else 1}b{beam}"
135135
for beam in [1, 2]
136136
for beam_id in [1, 2]
137137
for family in ["f", "d"]
138138
for sector in [1, 2, 3, 4, 5, 6, 7, 8]
139139
]
140140
LHC_KSS_KNOBS: list[str] = [ # skew sextupole correctors
141-
f"kss.a{sector}{sector+1 if sector < _MAX_SECTOR_VALUE else 1}b{beam}"
141+
f"kss.a{sector}{sector + 1 if sector < _MAX_SECTOR_VALUE else 1}b{beam}"
142142
for beam in [1, 2]
143143
for sector in [1, 2, 3, 4, 5, 6, 7, 8]
144144
]
145145
LHC_KCS_KNOBS: list[str] = [ # spool piece (skew) sextupoles
146-
f"kcs.a{sector}{sector+1 if sector < _MAX_SECTOR_VALUE else 1}b{beam}"
146+
f"kcs.a{sector}{sector + 1 if sector < _MAX_SECTOR_VALUE else 1}b{beam}"
147147
for beam in [1, 2]
148148
for sector in [1, 2, 3, 4, 5, 6, 7, 8]
149149
]
150150
LHC_KCO_KNOBS: list[str] = [ # spool piece (skew) octupoles
151-
f"kco.a{sector}{sector+1 if sector < _MAX_SECTOR_VALUE else 1}b{beam}"
151+
f"kco.a{sector}{sector + 1 if sector < _MAX_SECTOR_VALUE else 1}b{beam}"
152152
for beam in [1, 2]
153153
for sector in [1, 2, 3, 4, 5, 6, 7, 8]
154154
]
155155
LHC_KCD_KNOBS: list[str] = [ # spool piece (skew) decapoles
156-
f"kcd.a{sector}{sector+1 if sector < _MAX_SECTOR_VALUE else 1}b{beam}"
156+
f"kcd.a{sector}{sector + 1 if sector < _MAX_SECTOR_VALUE else 1}b{beam}"
157157
for beam in [1, 2]
158158
for sector in [1, 2, 3, 4, 5, 6, 7, 8]
159159
]
160160
LHC_KO_KNOBS: list[str] = [ # octupoles in arc short straight sections
161-
f"ko{family}.a{sector}{sector+1 if sector < _MAX_SECTOR_VALUE else 1}b{beam}"
161+
f"ko{family}.a{sector}{sector + 1 if sector < _MAX_SECTOR_VALUE else 1}b{beam}"
162162
for beam in [1, 2]
163163
for family in ["f", "d"]
164164
for sector in [1, 2, 3, 4, 5, 6, 7, 8]

pyhdtoolkit/cpymadtools/lhc/_powering.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,4 +513,4 @@ def _all_lhc_arcs(beam: int) -> list[str]:
513513
list[str]
514514
The list of arc names.
515515
"""
516-
return [f"A{i+1}{(i+1)%8+1}B{beam:d}" for i in range(8)]
516+
return [f"A{i + 1}{(i + 1) % 8 + 1}B{beam:d}" for i in range(8)]

pyhdtoolkit/utils/decorators.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ def function_wrapper(*args, **kwargs):
5555
current_call_source = "|".join(traceback.format_stack(inspect.currentframe()))
5656
if current_call_source not in function_wrapper.last_call_source:
5757
warnings.warn(
58-
f"Function {func.__name__} is now deprecated and will be removed in a future release! "
59-
f"{message}",
58+
f"Function {func.__name__} is now deprecated and will be removed in a future release! {message}",
6059
category=DeprecationWarning,
6160
stacklevel=2,
6261
)

0 commit comments

Comments
 (0)