-
Notifications
You must be signed in to change notification settings - Fork 6
520 feature request set n decimals as abstract method to latex formula #522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
520 feature request set n decimals as abstract method to latex formula #522
Conversation
Co-authored-by: PabloVasconez <pvascon@hotmail.com>
# Conflicts: # blueprints/type_alias.py
Thank you so much for contributing to Blueprints! This is your Pull Request # 2 to this project. Now that you've created your pull request, please don't go away; take a look at the bottom of this page for the automated checks that should already be running. If they pass, great! If not, please click on 'Details' and see if you can fix the problem they've identified. A maintainer should be along shortly to review your pull request and help get it added! |
@@ -41,12 +41,12 @@ def _evaluate( | |||
raise ValueError(f"Invalid f_ck: {f_ck}. f_ck cannot be negative") | |||
return 2.5 * (f_ck - 10) * 10**-6 | |||
|
|||
def latex(self) -> LatexFormula: | |||
def latex(self, n: int = 3) -> LatexFormula: | |||
"""Returns LatexFormula object for formula 3.12.""" | |||
return LatexFormula( | |||
return_symbol=r"\epsilon_{ca}(\infty)", | |||
result=f"{self:.6f}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one is not editable now. But it also cannot be the same amount of decimals as the others, as this value in particular is small. We need to think about a fix. Maybe max(6, n)?
@@ -57,15 +57,15 @@ def _evaluate( | |||
raise ValueError(f"Invalid t: {t}. t cannot be negative") | |||
return 5.39 * rho_1000 * np.exp(6.7 * mu) * (t / 1000) ** (0.75 * (1 - mu)) * 10**-5 | |||
|
|||
def latex(self) -> LatexFormula: | |||
def latex(self, n: int = 3) -> LatexFormula: | |||
"""Returns LatexFormula object for formula 3.28.""" | |||
return LatexFormula( | |||
return_symbol=r"\frac{\Delta \sigma_{pr}}{\sigma_{pl}}", | |||
result=f"{self:.6f}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as before
@@ -57,15 +57,15 @@ def _evaluate( | |||
raise ValueError(f"Invalid t: {t}. t cannot be negative") | |||
return 0.66 * rho_1000 * np.exp(9.1 * mu) * (t / 1000) ** (0.75 * (1 - mu)) * 10**-5 | |||
|
|||
def latex(self) -> LatexFormula: | |||
def latex(self, n: int = 3) -> LatexFormula: | |||
"""Returns LatexFormula object for formula 3.29.""" | |||
return LatexFormula( | |||
return_symbol=r"\frac{\Delta \sigma_{pr}}{\sigma_{pl}}", | |||
result=f"{self:.6f}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as before
@@ -57,15 +57,15 @@ def _evaluate( | |||
raise ValueError(f"Invalid t: {t}. t cannot be negative") | |||
return 1.98 * rho_1000 * np.exp(8 * mu) * (t / 1000) ** (0.75 * (1 - mu)) * 10**-5 | |||
|
|||
def latex(self) -> LatexFormula: | |||
def latex(self, n: int = 3) -> LatexFormula: | |||
"""Returns LatexFormula object for formula 3.30.""" | |||
return LatexFormula( | |||
return_symbol=r"\frac{\Delta \sigma_{pr}}{\sigma_{pl}}", | |||
result=f"{self:.6f}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as before
@@ -62,13 +62,14 @@ def _evaluate( | |||
|
|||
return k_r * k_phi * (f_yd / e_s) / (0.45 * d) | |||
|
|||
def latex(self) -> LatexFormula: | |||
def latex(self, n: int = 3) -> LatexFormula: | |||
"""Returns LatexFormula object for formula 5.34.""" | |||
return LatexFormula( | |||
return_symbol=r"\frac{1}{r}", | |||
result=f"{self:.6f}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as before
@@ -41,12 +41,12 @@ def _evaluate(f_ck: MPA, f_yk: MPA) -> DIMENSIONLESS: | |||
raise_if_negative(f_ck=f_ck, f_yk=f_yk) | |||
return (0.08 * np.sqrt(f_ck)) / f_yk | |||
|
|||
def latex(self) -> LatexFormula: | |||
def latex(self, n: int = 2) -> LatexFormula: | |||
"""Returns LatexFormula object for formula 9.5N.""" | |||
return LatexFormula( | |||
return_symbol=r"\rho_{w,min}", | |||
result=f"{self:.6f}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as before
@@ -95,6 +95,8 @@ | |||
"""Newton per square meter (N/m²), represented as a float.""" | |||
KN_M2 = float | |||
"""Kilonewton per square meter (kN/m²), represented as a float.""" | |||
KN_M3 = float | |||
"""Kilonewton per cubic meter (kN/m3), represented as a float.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
³
@@ -44,12 +44,12 @@ def _evaluate( | |||
raise_if_less_or_equal_to_zero(l_0=l_0) | |||
return theta_i * l_0 / 2 | |||
|
|||
def latex(self) -> LatexFormula: | |||
def latex(self, n: int = 3) -> LatexFormula: | |||
"""Returns LatexFormula object for formula 5.2.""" | |||
return LatexFormula( | |||
return_symbol=r"e_i", | |||
result=f"{self:.4f}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as before
@@ -53,13 +53,13 @@ def _evaluate( | |||
raise_if_negative(theta_0=theta_0, alpha_h=alpha_h, alpha_m=alpha_m) | |||
return theta_0 * alpha_h * alpha_m | |||
|
|||
def latex(self) -> LatexFormula: | |||
def latex(self, n: int = 3) -> LatexFormula: | |||
"""Returns LatexFormula object for formula 5.1.""" | |||
return LatexFormula( | |||
return_symbol=r"\theta_i", | |||
result=f"{self:.4f}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as before
msg = "Radius is equal to- or larger than 0.3m, use: Eq2Dot21ModulusHorizontalSubgrade" | ||
raise ValueError(msg) | ||
|
||
def latex(self, n: int = 3) -> LatexFormula: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nothing is preventing a user from submitting a negative value. maybe its wice to always pick the larger value of 0 and n?
…ct-method-to-latex-formula
Because of merges to the main, there are a few extra files that require this change. |
…ct-method-to-latex-formula
Description
Please write a description of the changes you made here.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
Checklist: