From 77d332840318e0624e046952ab23e64de02a1ea4 Mon Sep 17 00:00:00 2001 From: shimwell Date: Wed, 20 Apr 2022 23:16:58 +0100 Subject: [PATCH 1/3] removed vacuum from name --- .../render_of_random_reactor_render_gif.py | 6 +++--- paramak/parametric_components/dished_vacuum_vessel.py | 2 +- paramak/parametric_reactors/flf_system_code_reactor.py | 6 +++--- .../parametric_reactors/negative_triangularity_reactor.py | 4 ++-- .../test_flf_system_code_reactor.py | 8 ++++---- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/example_parametric_reactors/render_of_random_reactor_render_gif.py b/examples/example_parametric_reactors/render_of_random_reactor_render_gif.py index ffdb1ce27..3ebbe82bc 100644 --- a/examples/example_parametric_reactors/render_of_random_reactor_render_gif.py +++ b/examples/example_parametric_reactors/render_of_random_reactor_render_gif.py @@ -48,11 +48,11 @@ def create_reactor_renders( # assigns colours to each stl file stl_files_with_colors = { "blanket.stl": (255, 255, 0), - "vacuum_vessel.stl": (128, 128, 128), + "vessel.stl": (128, 128, 128), "upper_blanket.stl": (255, 255, 0), "lower_blanket.stl": (255, 255, 0), - "lower_vacuum_vessel.stl": (128, 128, 128), - "upper_vacuum_vessel.stl": (128, 128, 128), + "lower_vessel.stl": (128, 128, 128), + "upper_vessel.stl": (128, 128, 128), } scene = pyrender.Scene() diff --git a/paramak/parametric_components/dished_vacuum_vessel.py b/paramak/parametric_components/dished_vacuum_vessel.py index 20f53800d..a2fe7f456 100644 --- a/paramak/parametric_components/dished_vacuum_vessel.py +++ b/paramak/parametric_components/dished_vacuum_vessel.py @@ -23,7 +23,7 @@ def __init__( dish_height: float = 50, cylinder_height: float = 400, thickness: float = 15, - name: str = "dished_vacuum_vessel", + name: str = "dished_vessel", **kwargs, ): self.radius = radius diff --git a/paramak/parametric_reactors/flf_system_code_reactor.py b/paramak/parametric_reactors/flf_system_code_reactor.py index f6158508a..86680a0a5 100644 --- a/paramak/parametric_reactors/flf_system_code_reactor.py +++ b/paramak/parametric_reactors/flf_system_code_reactor.py @@ -90,7 +90,7 @@ def create_solids(self): ], rotation_angle=self.rotation_angle, color=(0.5, 0.5, 0.5), - name="lower_vacuum_vessel", + name="lower_vessel", ) lower_blanket = paramak.RotateStraightShape( @@ -137,7 +137,7 @@ def create_solids(self): ], rotation_angle=self.rotation_angle, color=(0.5, 0.5, 0.5), - name="upper_vacuum_vessel", + name="upper_vessel", ) upper_blanket = paramak.RotateStraightShape( @@ -201,7 +201,7 @@ def create_solids(self): ], rotation_angle=self.rotation_angle, color=(0.5, 0.5, 0.5), - name="vacuum_vessel", + name="vessel", ) self.shapes_and_components = [ diff --git a/paramak/parametric_reactors/negative_triangularity_reactor.py b/paramak/parametric_reactors/negative_triangularity_reactor.py index 3e1357887..34e805054 100644 --- a/paramak/parametric_reactors/negative_triangularity_reactor.py +++ b/paramak/parametric_reactors/negative_triangularity_reactor.py @@ -744,7 +744,7 @@ def _make_vacuum_vessel_inner_wall(self): inner_radius=self._vacuum_vessel_inwall_start_rad, outer_radius=self._vacuum_vessel_inwall_end_rad, rotation_angle=self._rotation_angle, - name="vacuum_vessel_inner_wall", + name="vessel_inner_wall", color=(0.5, 0.5, 0.5), cut=[self._pf_coils, self._pf_casing], ) @@ -896,7 +896,7 @@ def _make_vacuum_vessel(self): inner_radius=self._vacuum_vessel_inwall_start_rad, outer_radius=self._vacuum_vessel_body_end_rad, rotation_angle=self._rotation_angle, - name="vacuum_vessel_body", + name="vessel_body", cut=cutting_list, color=(0.5, 0.5, 0.5), ) diff --git a/tests/test_parametric_reactors/test_flf_system_code_reactor.py b/tests/test_parametric_reactors/test_flf_system_code_reactor.py index bcdd4835b..118265b6a 100644 --- a/tests/test_parametric_reactors/test_flf_system_code_reactor.py +++ b/tests/test_parametric_reactors/test_flf_system_code_reactor.py @@ -44,11 +44,11 @@ def test_multiple_stp_file_creation(self): os.system("rm *.stp") self.test_reactor.export_stp() - assert Path("lower_vacuum_vessel.stp").is_file() + assert Path("lower_vessel.stp").is_file() assert Path("lower_blanket.stp").is_file() assert Path("blanket.stp").is_file() assert Path("upper_blanket.stp").is_file() - assert Path("upper_vacuum_vessel.stp").is_file() + assert Path("upper_vessel.stp").is_file() assert Path("vacuum_vessel.stp").is_file() def test_graveyard_volume_in_brep_export(self): @@ -82,8 +82,8 @@ def test_order_of_names_in_reactor(self): "vacuum_vessel", "upper_blanket", "lower_blanket", - "lower_vacuum_vessel", - "upper_vacuum_vessel", + "lower_vessel", + "upper_vessel", ] def test_blanket_volume_against_analytical_volume(self): From 096fce86033362f43e96b6cfa850a63a569a9a69 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Thu, 21 Apr 2022 10:54:40 +0100 Subject: [PATCH 2/3] removed vacuum from name --- .../test_parametric_reactors/test_flf_system_code_reactor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_parametric_reactors/test_flf_system_code_reactor.py b/tests/test_parametric_reactors/test_flf_system_code_reactor.py index 118265b6a..aa34e037a 100644 --- a/tests/test_parametric_reactors/test_flf_system_code_reactor.py +++ b/tests/test_parametric_reactors/test_flf_system_code_reactor.py @@ -49,7 +49,7 @@ def test_multiple_stp_file_creation(self): assert Path("blanket.stp").is_file() assert Path("upper_blanket.stp").is_file() assert Path("upper_vessel.stp").is_file() - assert Path("vacuum_vessel.stp").is_file() + assert Path("vessel.stp").is_file() def test_graveyard_volume_in_brep_export(self): """Exports the reactor as a brep file and checks the number of volumes @@ -79,7 +79,7 @@ def test_order_of_names_in_reactor(self): assert self.test_reactor.name == [ "blanket", - "vacuum_vessel", + "vessel", "upper_blanket", "lower_blanket", "lower_vessel", From 1d944f2b93d7c1a5b069fbee84623bbbe7264ddb Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Thu, 21 Apr 2022 11:17:38 +0100 Subject: [PATCH 3/3] [skip ci] flake8 fixes --- paramak/parametric_components/constant_thickness_dome.py | 5 ++++- paramak/reactor.py | 1 - paramak/shape.py | 6 +++++- tests/test_parametric_shapes/test_extrude_mixed_shape.py | 3 ++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/paramak/parametric_components/constant_thickness_dome.py b/paramak/parametric_components/constant_thickness_dome.py index 45ee92e32..965eca63f 100644 --- a/paramak/parametric_components/constant_thickness_dome.py +++ b/paramak/parametric_components/constant_thickness_dome.py @@ -116,7 +116,10 @@ def find_points(self): # far side if self.chord_height * 2 >= self.chord_width: - msg = "ConstantThicknessDome requires that the self.chord_width is at least 2 times as large as the chord height" + msg = ( + "ConstantThicknessDome requires that the self.chord_width " + "is at least 2 times as large as the chord height" + ) raise ValueError(msg) radius_of_sphere = ((math.pow(self.chord_width, 2)) + (4.0 * math.pow(self.chord_height, 2))) / ( diff --git a/paramak/reactor.py b/paramak/reactor.py index e805cfa1a..563169f88 100644 --- a/paramak/reactor.py +++ b/paramak/reactor.py @@ -1,5 +1,4 @@ from collections.abc import Iterable -from logging import warning from pathlib import Path from typing import List, Optional, Tuple, Union diff --git a/paramak/shape.py b/paramak/shape.py index 0cbc57f9a..96745a146 100644 --- a/paramak/shape.py +++ b/paramak/shape.py @@ -278,7 +278,11 @@ def rotation_axis(self, value): raise ValueError(msg) for val in point: if not isinstance(val, (int, float)): - msg = f"Shape.rotation_axis should be an iterable of iterables where the nested iterables are numerical, not {type(val)}" + msg = ( + "Shape.rotation_axis should be an iterable of " + "iterables where the nested iterables are " + f"numerical, not {type(val)}" + ) raise ValueError(msg) if value[0] == value[1]: diff --git a/tests/test_parametric_shapes/test_extrude_mixed_shape.py b/tests/test_parametric_shapes/test_extrude_mixed_shape.py index 613d35dd9..179034845 100644 --- a/tests/test_parametric_shapes/test_extrude_mixed_shape.py +++ b/tests/test_parametric_shapes/test_extrude_mixed_shape.py @@ -190,7 +190,8 @@ def test_convert_all_circle_points_change_to_splines(self): assert self.test_shape_2.processed_points[-4] == (150, 100, "straight") assert self.test_shape_2.processed_points[-5] == (200, 100, "straight") - for point in self.test_shape_2.processed_points[1 : len(self.test_shape_2.points) - 5]: + spline_points = len(self.test_shape_2.points) - 5 + for point in self.test_shape_2.processed_points[1:spline_points]: assert point[2] == "spline" def test_convert_circles_to_splines_volume(self):