Skip to content

Commit 0d81365

Browse files
Further experiments with diagrams
1 parent 38e1ec4 commit 0d81365

File tree

4 files changed

+33
-47
lines changed

4 files changed

+33
-47
lines changed

app/tests/example_tests.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66

77
def create_diagram_for_documentation(filename, result):
88
for (index, graph) in enumerate(result["criteria_graphs_vis"].values()):
9-
with open(filename+"_"+str(index)+".html", "w") as f:
9+
with open(filename+"_"+str(index)+".md", "w") as f:
1010
#f.write(r'<!DOCTYPE html><html lang="en"><body><style>.mermaid {display: inline-flex;}</style>'+'\n')
1111
f.write("```mermaid")
1212
for g in result["criteria_graphs_vis"].values():
1313
print(g)
14-
f.write('<pre class="mermaid">\n'+g+'\n</pre>\n')
14+
#f.write('<pre class="mermaid">\n'+g+'\n</pre>\n')
15+
f.write(g)
1516
#f.write('<script type="module"> import mermaid from "https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs";</script></body></html>')
1617
f.write("```")
1718

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,23 @@
1-
```mermaid<pre class="mermaid">
2-
flowchart TD
1+
```mermaidflowchart TD
32
N_0_0(["2+answer > response<br/>---<br/>Checks if 2+answer > response is true."])
43
N_1_0["2+answer > response_TRUE<br/>---<br/>2+answer > response is true."]
54
N_1_1["2+answer > response_FALSE<br/>---<br/>2+answer > response is false."]
65
N_1_2["2+answer > response_UNKNOWN<br/>---<br/>2+answer > response is false."]
76
N_2_0{{"END<br/>---<br/>Evaluation completed."}}
8-
N_1_1 --> N_2_0
9-
N_1_0 --> N_2_0
10-
N_0_0 --> N_1_2
117
N_0_0 --> N_1_0
128
N_0_0 --> N_1_1
139
N_1_2 --> N_2_0
14-
</pre>
15-
<pre class="mermaid">
16-
flowchart TD
10+
N_1_0 --> N_2_0
11+
N_0_0 --> N_1_2
12+
N_1_1 --> N_2_0flowchart TD
1713
N_0_0(["answer <= response<br/>---<br/>Checks if answer <= response is true."])
1814
N_1_0["answer <= response_TRUE<br/>---<br/>answer <= response is true."]
1915
N_1_1["answer <= response_FALSE<br/>---<br/>answer <= response is false."]
2016
N_1_2["answer <= response_UNKNOWN<br/>---<br/>answer <= response is false."]
2117
N_2_0{{"END<br/>---<br/>Evaluation completed."}}
22-
N_1_1 --> N_2_0
23-
N_1_0 --> N_2_0
24-
N_0_0 --> N_1_2
2518
N_0_0 --> N_1_0
2619
N_0_0 --> N_1_1
2720
N_1_2 --> N_2_0
28-
</pre>
29-
```
21+
N_1_0 --> N_2_0
22+
N_0_0 --> N_1_2
23+
N_1_1 --> N_2_0```
Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,23 @@
1-
```mermaid<pre class="mermaid">
2-
flowchart TD
1+
```mermaidflowchart TD
32
N_0_0(["2+answer > response<br/>---<br/>Checks if 2+answer > response is true."])
43
N_1_0["2+answer > response_TRUE<br/>---<br/>2+answer > response is true."]
54
N_1_1["2+answer > response_FALSE<br/>---<br/>2+answer > response is false."]
65
N_1_2["2+answer > response_UNKNOWN<br/>---<br/>2+answer > response is false."]
76
N_2_0{{"END<br/>---<br/>Evaluation completed."}}
8-
N_1_1 --> N_2_0
9-
N_1_0 --> N_2_0
10-
N_0_0 --> N_1_2
117
N_0_0 --> N_1_0
128
N_0_0 --> N_1_1
139
N_1_2 --> N_2_0
14-
</pre>
15-
<pre class="mermaid">
16-
flowchart TD
10+
N_1_0 --> N_2_0
11+
N_0_0 --> N_1_2
12+
N_1_1 --> N_2_0flowchart TD
1713
N_0_0(["answer <= response<br/>---<br/>Checks if answer <= response is true."])
1814
N_1_0["answer <= response_TRUE<br/>---<br/>answer <= response is true."]
1915
N_1_1["answer <= response_FALSE<br/>---<br/>answer <= response is false."]
2016
N_1_2["answer <= response_UNKNOWN<br/>---<br/>answer <= response is false."]
2117
N_2_0{{"END<br/>---<br/>Evaluation completed."}}
22-
N_1_1 --> N_2_0
23-
N_1_0 --> N_2_0
24-
N_0_0 --> N_1_2
2518
N_0_0 --> N_1_0
2619
N_0_0 --> N_1_1
2720
N_1_2 --> N_2_0
28-
</pre>
29-
```
21+
N_1_0 --> N_2_0
22+
N_0_0 --> N_1_2
23+
N_1_1 --> N_2_0```
Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
```mermaid<pre class="mermaid">
2-
flowchart TD
1+
```mermaidflowchart TD
32
N_0_0(["response matches answer<br/>---<br/>Converts QUANTITY: response tags: {} and QUANTITY: answer tags: {} match to a common set of base units and compares their values."])
43
N_0_1(["response matches answer_DIMENSION_MATCH<br/>---<br/>Do the dimensions of QUANTITY: response tags: {} and QUANTITY: answer tags: {} match?"])
54
N_0_2(["response matches answer_UNIT_COMPARISON<br/>---<br/>Compares how similar the units of QUANTITY: response tags: {} and QUANTITY: answer tags: {} are."])
@@ -16,27 +15,25 @@
1615
N_1_10["response matches answer_UNIT_COMPARISON_PREFIX_IS_LARGE<br/>---<br/>The units of QUANTITY: response tags: {} are at least 1000 times greater than the units of QUANTITY: answer tags: {}."]
1716
N_1_11["response matches answer_UNIT_COMPARISON_PREFIX_IS_SMALL<br/>---<br/>The units of QUANTITY: response tags: {} are at least 1000 times smaller than the units of QUANTITY: answer tags: {}."]
1817
N_2_0{{"END<br/>---<br/>Evaluation completed."}}
19-
N_0_0 --> N_1_5
20-
N_1_4 --> N_2_0
21-
N_0_2 --> N_1_11
2218
N_0_0 --> N_1_1
19+
N_0_0 --> N_1_2
20+
N_1_3 --> N_2_0
2321
N_1_2 --> N_2_0
24-
N_0_0 --> N_1_3
25-
N_1_10 --> N_2_0
26-
N_1_7 --> N_2_0
27-
N_0_2 --> N_1_9
22+
N_0_0 --> N_1_5
2823
N_0_0 --> N_1_4
24+
N_1_0 --> N_0_2
25+
N_0_1 --> N_1_7
2926
N_1_5 --> N_2_0
30-
N_0_1 --> N_1_6
31-
N_1_1 --> N_0_1
27+
N_1_10 --> N_2_0
28+
N_0_0 --> N_1_3
3229
N_0_2 --> N_1_8
33-
N_1_11 --> N_2_0
3430
N_0_2 --> N_1_10
35-
N_0_0 --> N_1_2
36-
N_0_0 --> N_1_0
37-
N_0_1 --> N_1_7
38-
N_1_0 --> N_0_2
39-
N_1_3 --> N_2_0
31+
N_1_7 --> N_2_0
32+
N_0_2 --> N_1_9
33+
N_0_2 --> N_1_11
4034
N_1_6 --> N_2_0
41-
</pre>
42-
```
35+
N_0_0 --> N_1_0
36+
N_1_1 --> N_0_1
37+
N_0_1 --> N_1_6
38+
N_1_4 --> N_2_0
39+
N_1_11 --> N_2_0```

0 commit comments

Comments
 (0)