Skip to content

Commit 4f51ebd

Browse files
committed
Merge branch 'main' into 503-feature-request-add-formulas-617-622-from-nen_en_1993_1_1
# Conflicts: # docs/objects_overview/eurocode/ec3_1993_1_1_2016/formulas.md
2 parents ae534cd + de61c37 commit 4f51ebd

File tree

95 files changed

+6093
-239
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+6093
-239
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ body:
1414
required: true
1515
- label: >
1616
I have confirmed this bug exists on the
17-
[latest version](https://pypi.org/project/blueprints/) of Blueprints.
17+
[latest version](https://pypi.org/project/blue-prints/) of Blueprints.
1818
required: true
1919
2020
- type: textarea

.github/ISSUE_TEMPLATE/formula_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ body:
1313
attributes:
1414
label: "Formula Description"
1515
description: "Describe the formula you're suggesting to add."
16-
placeholder: "Add equation XXX to YYY from Eurocode ZZZ to the project."
16+
value: "Add equation XXX to YYY from Eurocode ZZZ to the project."
1717
validations:
1818
required: true
1919

@@ -22,7 +22,7 @@ body:
2222
attributes:
2323
label: "Acceptance Criteria"
2424
description: "List the conditions that the formula must fulfill to be considered complete."
25-
placeholder: "- [ ] Add the formula to the code\n- [ ] Add latex expression to the formula\n- [ ] Add unittests\n- [ ] Add docstrings\n- [ ] Update table in docs with classname(s)"
25+
value: "- [ ] Add the formula to the code\n- [ ] Add latex expression to the formula\n- [ ] Add unittests\n- [ ] Add docstrings\n- [ ] Update table in docs with classname(s)"
2626
validations:
2727
required: true
2828

.github/prompts/casus_formula.prompt.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- LaTeX variables should be rounded to 3 decimals.
1111
- The LaTex _numeric_equation_with_units should include units, except when its dimensionless
1212
- Import the necessary typehinting with type alias units found in type_alias.py and remove the unused imported type aliases. Forces in N, (Bending) moments in Nmm, distances in mm, areas in mm^2, Stress in MPa, angles in DEG, no unit is DIMENSIONLESS. When dealing with angles, use np.deg2rad.
13+
- Test the value of denominators with raise_if_less_or_equal_to_zero. For all others, test with raise_if_negative.
1314

1415
## Template for service
1516

.github/prompts/comparison_formula.prompt.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- LaTeX variables should be rounded to 3 decimals.
1111
- The LaTex _numeric_equation_with_units should include units, except when its dimensionless
1212
- Import the necessary typehinting with type alias units found in type_alias.py and remove the unused imported type aliases. Forces in N, (Bending) moments in Nmm, distances in mm, areas in mm^2, Stress in MPa, angles in DEG, no unit is DIMENSIONLESS. When dealing with angles, use np.deg2rad.
13+
- Test the value of denominators with raise_if_less_or_equal_to_zero. For all others, test with raise_if_negative.
1314

1415
## Template for service
1516

.github/prompts/equation_formula.prompt.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- LaTeX variables should be rounded to 3 decimals.
1010
- The LaTex _numeric_equation_with_units should include units, except when its dimensionless
1111
- Import the necessary typehinting with type alias units found in type_alias.py and remove the unused imported type aliases. Forces in N, (Bending) moments in Nmm, distances in mm, areas in mm^2, Stress in MPa, angles in DEG, no unit is DIMENSIONLESS. When dealing with angles, use np.deg2rad.
12+
- Test the value of denominators with raise_if_less_or_equal_to_zero. For all others, test with raise_if_negative.
1213

1314
## Template for service
1415

.github/workflows/build_deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- uses: actions/checkout@v4
2525

2626
- name: install uv
27-
uses: astral-sh/setup-uv@v5
27+
uses: astral-sh/setup-uv@v6
2828

2929
- name: Set up Python ${{ matrix.python-version }}
3030
uses: actions/setup-python@v5

.github/workflows/code_coverage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/checkout@v4
1717

1818
- name: install uv
19-
uses: astral-sh/setup-uv@v5
19+
uses: astral-sh/setup-uv@v6
2020

2121
- name: Setup python ${{ matrix.python-version }}
2222
uses: actions/setup-python@v5

.github/workflows/minimum_code_coverage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions/checkout@v4
2020

2121
- name: install uv
22-
uses: astral-sh/setup-uv@v5
22+
uses: astral-sh/setup-uv@v6
2323

2424
- name: Setup python ${{ matrix.python-version }}
2525
uses: actions/setup-python@v5

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@v4
1818

1919
- name: install uv
20-
uses: astral-sh/setup-uv@v5
20+
uses: astral-sh/setup-uv@v6
2121

2222
- name: Set up Python ${{ matrix.python-version }}
2323
uses: actions/setup-python@v5

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
repos:
1919
- repo: https://github.com/astral-sh/ruff-pre-commit
20-
rev: v0.11.2
20+
rev: v0.11.8
2121
hooks:
2222
# Run the linter.
2323
- id: ruff

.readthedocs.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ formats:
2525
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
2626
python:
2727
install:
28-
- requirements: docs/requirements_docs.txt
28+
- requirements: docs/requirements_docs.txt
29+
- method: pip
30+
path: .

.ruff.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ ignore = [
7575
"RUF002", # ambiguous-unicode-character-docstring
7676
"RUF003", # ambiguous-unicode-character-comment
7777
]
78+
[lint.per-file-ignores]
79+
"docs/*" = ["T201"]
7880

7981
[format]
8082
quote-style = "double"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
[![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=flat&logo=linkedin&logoColor=white)](https://www.linkedin.com/company/blueprints-org)
12
[![Run Tests](https://github.com/Blueprints-org/blueprints/actions/workflows/test.yaml/badge.svg)](https://github.com/Blueprints-org/blueprints/actions/workflows/test.yaml)
23
[![Read the Docs](https://img.shields.io/readthedocs/blueprints?logo=readthedocs&label=Read%20the%20docs&link=https%3A%2F%2Fblueprints.readthedocs.io%2Fen%2Flatest%2F)](https://blueprints.readthedocs.io/en/latest/)
34
[![codecov](https://codecov.io/gh/Blueprints-org/blueprints/branch/main/graph/badge.svg?token=vwYQBShr9q)](https://codecov.io/gh/Blueprints-org/blueprints)
@@ -6,7 +7,6 @@
67
[![Python versions](https://img.shields.io/badge/python-3.12%20%7C%203.13-blue?style=flat&logo=python)](https://badge.fury.io/py/blueprints)
78

89

9-
1010
<picture>
1111
<source media="(prefers-color-scheme: dark)" srcset="docs/_overrides/assets/images/blueprints_banner.png">
1212
<source media="(prefers-color-scheme: light)" srcset="docs/_overrides/assets/images/blueprints_banner.png">

blueprints/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Blueprints."""
22

3-
__version__ = "0.2.0"
3+
__version__ = "0.3.0"
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
"""Formula 4.4N from NEN-EN 1992-1-1+C2:2011: Chapter 4 - Durability and cover to reinforcement."""
2+
3+
from blueprints.codes.eurocode.nen_en_1992_1_1_c2_2011 import NEN_EN_1992_1_1_C2_2011
4+
from blueprints.codes.formula import Formula
5+
from blueprints.codes.latex_formula import LatexFormula, latex_replace_symbols
6+
from blueprints.type_alias import MM
7+
from blueprints.validations import raise_if_less_or_equal_to_zero
8+
9+
10+
class Form4Dot4NCheckExecutionTolerances(Formula):
11+
r"""Class representing formula 4.4N for calculating the allowance in design for execution tolerances
12+
[$\Delta c_{dev}$] [$mm$]. Used, where it can be assured that a very accurate measurement device is used
13+
for monitoring and non conforming members are rejected (e.g. precast elements).
14+
15+
NEN-EN 1992-1-1+C2:2011 art.4.4.1.3 (3) - formula (4.4N)
16+
17+
Parameters
18+
----------
19+
delta_cdev : MM
20+
[$\Delta c_{dev}$] Concrete cover including execution tolerances [$mm$].
21+
"""
22+
23+
label = "4.4N"
24+
source_document = NEN_EN_1992_1_1_C2_2011
25+
26+
def __init__(
27+
self,
28+
delta_cdev: MM,
29+
) -> None:
30+
super().__init__()
31+
self.delta_cdev = delta_cdev
32+
33+
@staticmethod
34+
def _evaluate(
35+
delta_cdev: MM,
36+
) -> bool:
37+
"""Evaluates the formula, for more information see the __init__ method."""
38+
raise_if_less_or_equal_to_zero(delta_cdev=delta_cdev)
39+
40+
return 0 <= delta_cdev <= 10
41+
42+
def latex(self) -> LatexFormula:
43+
"""Returns LatexFormula object for formula 4.3N."""
44+
_equation: str = r"0 \leq \Delta c_{dev} \leq 10"
45+
_numeric_equation: str = latex_replace_symbols(
46+
_equation,
47+
{
48+
r"\Delta c_{dev}": f"{self.delta_cdev:.3f}",
49+
},
50+
False,
51+
)
52+
return LatexFormula(
53+
return_symbol=r"CHECK",
54+
result="OK" if self.__bool__() else "\\text{Not OK}",
55+
equation=_equation,
56+
numeric_equation=_numeric_equation,
57+
comparison_operator_label="\\to",
58+
unit="",
59+
)

0 commit comments

Comments
 (0)