From 68f6ee793164642ea8bcebd7da15ce23372331df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20Garc=C3=ADa=20M=C3=A9ndez?= <44614728+egarciamendez@users.noreply.github.com> Date: Wed, 6 Nov 2024 22:40:13 +0100 Subject: [PATCH] testing RectangularReinforcedCrossSection --- .../reinforced_concrete_sections/plotters/rectangular.py | 5 ++++- .../reinforced_concrete_sections/test_rectangular.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/blueprints/structural_sections/concrete/reinforced_concrete_sections/plotters/rectangular.py b/blueprints/structural_sections/concrete/reinforced_concrete_sections/plotters/rectangular.py index 1aaa0669..4d0164f5 100644 --- a/blueprints/structural_sections/concrete/reinforced_concrete_sections/plotters/rectangular.py +++ b/blueprints/structural_sections/concrete/reinforced_concrete_sections/plotters/rectangular.py @@ -48,6 +48,7 @@ def plot( custom_text_height: str | None = None, offset_line_width: float = 1.25, offset_line_height: float = 1.2, + center_line_style: dict[str, float | str] | None = None, show: bool = False, axes_i: int = 0, ) -> plt.Figure: @@ -77,6 +78,8 @@ def plot( Offset of the width line. offset_line_height: float Offset of the height line. + center_line_style: dict[str, float | str] | None + Style of the center lines. Check matplotlib documentation for more information (Annotation-arrowprops). show: bool Show the plot. axes_i: int @@ -89,7 +92,7 @@ def plot( """ self._start_plot(figsize=figsize) self._add_rectangle(axes_i=axes_i) - self._add_center_lines(axes_i=axes_i) + self._add_center_lines(axes_i=axes_i, style=center_line_style) self._add_dimension_lines( axes_i=axes_i, font_size_dimension=font_size_dimension, diff --git a/tests/structural_sections/concrete/reinforced_concrete_sections/test_rectangular.py b/tests/structural_sections/concrete/reinforced_concrete_sections/test_rectangular.py index 1226e80e..71b8bd34 100644 --- a/tests/structural_sections/concrete/reinforced_concrete_sections/test_rectangular.py +++ b/tests/structural_sections/concrete/reinforced_concrete_sections/test_rectangular.py @@ -132,7 +132,7 @@ def test_add_longitudinal_reinforcement_by_quantity_wrong_edge( def test_plot(self, rectangular_reinforced_cross_section: RectangularReinforcedCrossSection) -> None: """Test the plot method.""" - plot = rectangular_reinforced_cross_section.plot(show=False) + plot = rectangular_reinforced_cross_section.plot(show=False, center_line_style={"linewidth": 0.85}) assert isinstance(plot, plt.Figure) def test_reinforcement_weight_longitudinal_bars(self, rectangular_reinforced_cross_section: RectangularReinforcedCrossSection) -> None: