Skip to content

covers

structural_sections.concrete.covers

Module with the representation of the covers for cross-sections.

Classes:

structural_sections.concrete.covers.CoversRectangular dataclass

CoversRectangular(
    upper: MM = DEFAULT_COVER,
    right: MM = DEFAULT_COVER,
    lower: MM = DEFAULT_COVER,
    left: MM = DEFAULT_COVER,
)

Representation of the covers of a rectangular cross-section.

structural_sections.concrete.covers.CoversRectangular.get_covers_info

get_covers_info() -> str

Return a string with the covers of the cross-section.

Source code in blueprints/structural_sections/concrete/covers.py
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
def get_covers_info(self) -> str:
    """Return a string with the covers of the cross-section."""
    caption_text = "Cover:"

    covers = defaultdict(list)

    for key, value in asdict(self).items():
        covers[value].append(key)

    if len(covers) == 1:
        return f"{caption_text} {self.upper:.0f} mm"

    cover_texts = [caption_text]

    for cover, names in covers.items():
        cover_texts.append(f"{'|'.join(names)}: {cover:.0f} mm")

    return "\n  ".join(cover_texts)

structural_sections.concrete.covers.CoversRectangular.validate

validate() -> None

Validate the covers.

Source code in blueprints/structural_sections/concrete/covers.py
44
45
46
def validate(self) -> None:
    """Validate the covers."""
    raise_if_negative(upper=self.upper, right=self.right, lower=self.lower, left=self.left)