Skip to content

Commit 6207a2f

Browse files
committed
🚨 Ruff fixes
1 parent 674a0ac commit 6207a2f

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

bluemira/builders/coil_supports.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,7 @@ def _make_rib_profile(self, support_face):
520520

521521
rib_wire = make_polygon({"x": x, "y": 0.0, "z": z}, closed=True)
522522

523-
rib_face = BluemiraFace(rib_wire)
524-
525-
return rib_face
523+
return BluemiraFace(rib_wire)
526524

527525
def _make_ribs(self, width, support_face):
528526
xz_profile = self._make_rib_profile(support_face)

bluemira/builders/tools.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,14 +295,15 @@ def pattern_revolved_silhouette(
295295
except ValueError:
296296
# TODO @CoronelBuendia: Unknown cause of failure in valid FreeCAD
297297
# geometries... likely related to precision
298+
# 3586
298299
bluemira_warn(
299300
"Boolean cutting operation in pattern_revolved_silhouette has failed, "
300301
"trying our best by scaling up the problem. If you don't see a "
301302
"subsequent warning, all went to plan."
302303
)
303304
volume.scale(1000)
304-
for gap in gaps:
305-
gap.scale(1000)
305+
for gap_ in gaps:
306+
gap_.scale(1000)
306307
try:
307308
shapes = boolean_cut(volume, gaps)
308309
for shape in shapes:

eudemo/eudemo/blanket/builder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,12 @@ def _subdivide_poloidally(
208208
return fw, bz, manifold
209209

210210
def get_segments(
211-
self, silhouette: BluemiraFace, sub_name: str, inboard: bool, color_index: int
211+
self, silhouette: BluemiraFace, sub_name: str, *, inboard: bool, color_index: int
212212
):
213213
"""
214214
Create the sub-layer-segments of the blanket from a silhouette of
215215
a sub-layer.
216-
"""
216+
""" # noqa: DOC201
217217
if inboard:
218218
n_seg_per_sector = self.params.n_bb_inboard.value
219219
name = self.IBS

eudemo/eudemo/ivc/divertor_silhouette.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,10 @@ def _make_circular_baffle(
387387
blanket_join_point:
388388
The position (in x-z) where the baffle
389389
joins to the blanket wall
390-
target_start_point:
390+
target_baffle_join_point:
391391
The position (in x-z) where the baffle
392392
is tangent and joins to the target.
393-
target_end_point:
393+
target_gradient:
394394
The position (in x-z) where the target
395395
joins to the dome.
396396

eudemo/eudemo/reactor.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -902,13 +902,12 @@ def save_reactor(reactor, reactor_config, folder_name):
902902

903903
a_string = f"{reactor_config.global_params.A.value:.2f}".replace(".", "_")
904904
folder_name = f"results_v02/A_{a_string}"
905-
import os
906-
os.makedirs(folder_name, exist_ok=True)
905+
Path(folder_name).mkdir(exist_ok=True, parents=True)
907906
filename = f"{folder_name}/run_time.json"
908907
with open(filename, "w") as f:
909908
json.dump(run_time_track, f, indent=2)
910909
save_reactor(reactor, reactor_config, folder_name=folder_name)
911910

912911
except Exception as e:
913912
bluemira_error(e.with_traceback(e.__traceback__))
914-
raise e
913+
raise

eudemo/eudemo_tests/blanket/test_blanket.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
#
55
# SPDX-License-Identifier: LGPL-2.1-or-later
66

7-
from bluemira.geometry.coordinates import Coordinates
8-
from eudemo.blanket import Blanket, BlanketBuilder
7+
from eudemo.blanket import BlanketBuilder
98
from eudemo_tests.blanket.tools import make_simple_blanket
109

1110

@@ -26,7 +25,6 @@ def make_blanket_component():
2625
build_config={},
2726
ib_silhouette=segments.inboard,
2827
ob_silhouette=segments.outboard,
29-
panel_points=panel_points
28+
panel_points=panel_points,
3029
)
3130
return params, segments, builder.build()
32-

eudemo/eudemo_tests/blanket/tools.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#
55
# SPDX-License-Identifier: LGPL-2.1-or-later
66
import numpy as np
7+
78
from bluemira.geometry.coordinates import Coordinates
89
from bluemira.geometry.face import BluemiraFace
910
from bluemira.geometry.tools import make_circle, make_polygon
@@ -48,7 +49,10 @@ def make_simple_blanket() -> tuple[Coordinates, BlanketSegments]:
4849
inner.set_ccw([0, 1, 0])
4950
outer = ob_arc_inner.discretise(ndiscr=10)
5051
outer.set_ccw([0, 1, 0])
51-
panel_points = Coordinates({"x": np.concatenate([inner.x, outer.x]), "z": np.concatenate([inner.z, outer.z])})
52+
panel_points = Coordinates({
53+
"x": np.concatenate([inner.x, outer.x]),
54+
"z": np.concatenate([inner.z, outer.z]),
55+
})
5256

5357
return panel_points, BlanketSegments(
5458
inboard=inboard,

0 commit comments

Comments
 (0)