You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/evaluation.py
+10-5Lines changed: 10 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -22,19 +22,24 @@
22
22
deffeedback_not_dimensionless(groups):
23
23
groups=list(groups)
24
24
iflen(groups) ==1:
25
-
returnf"The group {str(groups[0])} is not dimensionless."
25
+
returnf"The group {convert_to_latex(groups[0])} is not dimensionless."
26
26
else:
27
-
return"The groups "+", ".join([str(g) forgingroups[0:-1]])+" and "+str(groups[-1])+" are not dimensionless."
27
+
return"The groups "+", ".join([convert_to_latex(g) forgingroups[0:-1]])+" and "+convert_to_latex(groups[-1])+" are not dimensionless."
28
28
29
+
defconvert_to_latex(expr):
30
+
ifisinstance(expr, str):
31
+
returnexpr
32
+
else:
33
+
return"$"+latex(expr)+"$"
29
34
30
35
buckingham_pi_feedback_responses= {
31
36
"VALID_CANDIDATE_SET": "",
32
37
"NOT_DIMENSIONLESS": feedback_not_dimensionless,
33
38
"MORE_GROUPS_THAN_REFERENCE_SET": "Response has more groups than necessary.",
34
39
"CANDIDATE_GROUPS_NOT_INDEPENDENT": lambdar, n: f"Groups in response are not independent. It has {r} independent group(s) and contains {n} groups.",
35
40
"TOO_FEW_INDEPENDENT_GROUPS": lambdaname, r, n: f"{name} contains too few independent groups. It has {r} independent group(s) and needs at least {n} independent groups.",
"SUM_WITH_INDEPENDENT_TERMS": lambdas: f"Sum in {s} group contains more independent terms that there are groups in total. Group expressions should ideally be written as a comma-separated list where each item is an entry of the form `q_1**c_1*q_2**c_2*...*q_n**c_n`."
"SUM_WITH_INDEPENDENT_TERMS": lambdas: f"Sum in {convert_to_latex(s)} contains more independent terms that there are groups in total. Group expressions should ideally be written as a comma-separated list where each item is an entry of the form `q_1**c_1*q_2**c_2*...*q_n**c_n`."
0 commit comments