scilens 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. scilens/LICENSE +37 -0
  2. scilens/__init__.py +1 -0
  3. scilens/app.py +9 -0
  4. scilens/cli/__init__.py +0 -0
  5. scilens/cli/cglb.py +10 -0
  6. scilens/cli/config.py +15 -0
  7. scilens/cli/info.py +12 -0
  8. scilens/cli/main.py +74 -0
  9. scilens/components/analyse_folder.py +4 -0
  10. scilens/components/compare_2_files.py +22 -0
  11. scilens/components/compare_errors.py +22 -0
  12. scilens/components/compare_floats.py +39 -0
  13. scilens/components/compare_folders.py +39 -0
  14. scilens/components/executor.py +58 -0
  15. scilens/components/file_reader.py +29 -0
  16. scilens/config/__init__.py +0 -0
  17. scilens/config/cli_run_options.py +8 -0
  18. scilens/config/env_var.py +3 -0
  19. scilens/config/load.py +40 -0
  20. scilens/config/models/__init__.py +12 -0
  21. scilens/config/models/app.py +9 -0
  22. scilens/config/models/compare.py +5 -0
  23. scilens/config/models/compare_float_thresholds.py +4 -0
  24. scilens/config/models/execute.py +4 -0
  25. scilens/config/models/execute_and_compare.py +4 -0
  26. scilens/config/models/file_reader.py +3 -0
  27. scilens/config/models/reader_format_csv.py +18 -0
  28. scilens/config/models/reader_format_txt.py +5 -0
  29. scilens/config/models/readers.py +4 -0
  30. scilens/config/models/report.py +6 -0
  31. scilens/config/models/report_html.py +6 -0
  32. scilens/config/models/report_output.py +4 -0
  33. scilens/helpers/assets.py +27 -0
  34. scilens/helpers/search_and_index.py +26 -0
  35. scilens/helpers/templates/index.html +20 -0
  36. scilens/helpers/templates/style.css +124 -0
  37. scilens/processors/__init__.py +3 -0
  38. scilens/processors/analyse.py +14 -0
  39. scilens/processors/compare.py +7 -0
  40. scilens/processors/execute_and_compare.py +17 -0
  41. scilens/processors/models/__init__.py +0 -0
  42. scilens/processors/models/results.py +2 -0
  43. scilens/processors/processor_interface.py +9 -0
  44. scilens/readers/__init__.py +0 -0
  45. scilens/readers/exceptions.py +1 -0
  46. scilens/readers/reader_com_txt_lines.py +2 -0
  47. scilens/readers/reader_csv.py +73 -0
  48. scilens/readers/reader_interface.py +15 -0
  49. scilens/readers/reader_manager.py +30 -0
  50. scilens/readers/reader_txt.py +82 -0
  51. scilens/readers/transform.py +8 -0
  52. scilens/report/__init__.py +0 -0
  53. scilens/report/assets/logo.svg +9 -0
  54. scilens/report/assets/logo_cglb.svg +1 -0
  55. scilens/report/assets.py +11 -0
  56. scilens/report/html_report.py +26 -0
  57. scilens/report/report.py +30 -0
  58. scilens/report/template.py +8 -0
  59. scilens/report/templates/body_01_title.html +61 -0
  60. scilens/report/templates/body_99_footer.html +11 -0
  61. scilens/report/templates/compare_11_summary.html +75 -0
  62. scilens/report/templates/compare_12_sections.html +150 -0
  63. scilens/report/templates/compare_13_section_numbers copy.html +48 -0
  64. scilens/report/templates/compare_13_section_numbers.html +91 -0
  65. scilens/report/templates/index.html +92 -0
  66. scilens/report/templates/js_chartlibs_echarts.js +34 -0
  67. scilens/report/templates/js_chartlibs_plotly.js +55 -0
  68. scilens/report/templates/js_com_dom.js +21 -0
  69. scilens/report/templates/js_com_page.js +199 -0
  70. scilens/report/templates/js_com_palette.js +7 -0
  71. scilens/report/templates/js_curvemgr.js +319 -0
  72. scilens/report/templates/style.css +144 -0
  73. scilens/report/templates/utils_compare_report_anim.js +73 -0
  74. scilens/report/templates/utils_compare_report_framesseries.js +143 -0
  75. scilens/report/vendors/tailwindcss_3_4_15.js +83 -0
  76. scilens/report/vendors/tailwindcss_min_4.0.0-beta.4.js +26 -0
  77. scilens/run/__init__.py +0 -0
  78. scilens/run/models/task_results.py +5 -0
  79. scilens/run/models/task_runtime.py +2 -0
  80. scilens/run/run_task.py +41 -0
  81. scilens/run/standalone_task_runner.py +9 -0
  82. scilens/run/task_context.py +12 -0
  83. scilens/run/tasks_collector.py +52 -0
  84. scilens/utils/dict.py +6 -0
  85. scilens/utils/file.py +43 -0
  86. scilens/utils/php.py +15 -0
  87. scilens/utils/system.py +2 -0
  88. scilens/utils/template.py +5 -0
  89. scilens/utils/time_tracker.py +6 -0
  90. scilens/utils/vectors.py +4 -0
  91. scilens/utils/web.py +20 -0
  92. scilens-0.1.0.dist-info/METADATA +44 -0
  93. scilens-0.1.0.dist-info/RECORD +95 -0
  94. scilens-0.1.0.dist-info/WHEEL +4 -0
  95. scilens-0.1.0.dist-info/entry_points.txt +3 -0
@@ -0,0 +1,75 @@
1
+ <section id="section_0" style="display: none;">
2
+
3
+ <h2>Summary</h2>
4
+
5
+ <!-- FILES -->
6
+ <h3>
7
+ Datasets <action data-command="toogle" data-args="section_summary_datasets"></action>
8
+ </h3>
9
+
10
+ <div id="section_summary_datasets">
11
+ <table>
12
+ <tr>
13
+ <th class="p-2" rowspan="2">#</th>
14
+ <th class="p-2" rowspan="2">Status</th>
15
+ <th class="p-2" rowspan="2">Name</th>
16
+ <th class="p-2" rowspan="2">Details</th>
17
+ <th class="p-2" rowspan="2" class="test-bg-50">Open test</th>
18
+ <th class="p-2" rowspan="2" class="refe-bg-50">Open Ref</th>
19
+ <th class="p-2" rowspan="2">Error</th>
20
+ <th class="p-2" colspan="3" >&nbsp;&nbsp;Comparison&nbsp;&nbsp;</th>
21
+ <th class="p-2" colspan="2">Nb Lines - Raw&nbsp;&nbsp;&nbsp;</th>
22
+ <th class="p-2" colspan="2">Nb Lines - Ignore</th>
23
+ <th class="p-2" colspan="2">Nb Lines - Number</th>
24
+ <th class="p-2" rowspan="2">Reader</th>
25
+ </tr>
26
+ <tr>
27
+ <th class="p-2" >Err.</th>
28
+ <th class="p-2" >Warn.</th>
29
+ <th class="p-2" >Diff.</th>
30
+ <th class="p-2 test-bg-50">Test</th>
31
+ <th class="p-2 refe-bg-50">Ref.</th>
32
+ <th class="p-2 test-bg-50">Test</th>
33
+ <th class="p-2 refe-bg-50">Ref.</th>
34
+ <th class="p-2 test-bg-50">Test</th>
35
+ <th class="p-2 refe-bg-50">Ref.</th>
36
+ </tr>
37
+ {% for file in data.files %}
38
+ <tr>
39
+ <td>{{ loop.index }}</td>
40
+ <td class="{{ ns.statuses[loop.index] }}">{{ ns.statuses[loop.index] }}</td>
41
+ <td>{{ file.name }}</td>
42
+ <td class="center">{% if not file.skipped %}<button onclick="actions.see_details({{ loop.index }})">[...]</button>{% endif %}</td>
43
+ <td class="center test-bg-20">
44
+ {% if file.test.origin and file.test.origin.path %}<action data-command="open_file" data-args="{{ file.test.origin.path.replace(meta.execution_dir, "") }}" data-label="[...]"></action>{% endif %}
45
+ </td>
46
+ <td class="center refe-bg-20">
47
+ {% if file.ref.origin and file.ref.origin.path %}<action data-command="open_file" data-args="{{ file.ref.origin.path.replace(meta.execution_dir, "") }}" data-label="[...]"></action>{% endif %}
48
+ </td>
49
+ <td class="{{ 'ERROR' if file.error else '' }}">
50
+ {% if file.error %}<span>{{ file.error }}</span>{% endif %}
51
+ </td>
52
+ <td class="number {{ 'ERROR' if file.comparison_errors.error_nb else '' }}">{{ file.comparison_errors.error_nb }}</td>
53
+ <td class="number {{ 'WARNING' if file.comparison_errors.warning_nb else '' }}">{{ file.comparison_errors.warning_nb }}</td>
54
+ <td class="number">{{ file.comparison.total_diffs }}</td>
55
+ <td class="number test-bg-20">{{ file.test.raw_lines_number }}</td>
56
+ <td class="number refe-bg-20">{{ file.ref.raw_lines_number }}</td>
57
+ <td class="number test-bg-20">{{ file.test.ignore_lines_number }}</td>
58
+ <td class="number refe-bg-20">{{ file.ref.ignore_lines_number }}</td>
59
+ <td class="number test-bg-20">{{ file.test.floats_lines_number }}</td>
60
+ <td class="number refe-bg-20">{{ file.ref.floats_lines_number }}</td>
61
+ <td class="">{{ file.test.reader }}</td>
62
+ </tr>
63
+ {% endfor %}
64
+ </table>
65
+ </div>
66
+
67
+ <!-- INFO -->
68
+
69
+ <!-- <h3>
70
+ Variables and Rules
71
+ <action data-command="toogle" data-args="section_variables_and_rules"></action>
72
+ </h3>
73
+ <div id="section_variables_and_rules" style="display:none;"></div> -->
74
+
75
+ </section>
@@ -0,0 +1,150 @@
1
+ {% for file in data.files %}
2
+ {% if not file.skipped %}
3
+
4
+
5
+ <section id="section_{{ loop.index }}" style="display: none;">
6
+ <!-- TITLE -->
7
+ <h2>
8
+ {{ file.name }}
9
+ <span class="{{ ns.statuses[loop.index] }}">{{ ns.statuses[loop.index] }}</span>
10
+ <span style="font-size:0.9rem;color:#666;">(#{{ loop.index }})</span>
11
+ <!-- actions -->
12
+ <action data-command="toogle" data-args="file_content_{{ loop.index|string }}"></action>
13
+ {% if file.test.origin and file.test.origin.path %}<action data-command="open_file" data-args="{{ file.test.origin.path.replace(meta.execution_dir, "") }}" data-label="Open Test"></action>{% endif %}
14
+ {% if file.ref.origin and file.ref.origin.path %}<action data-command="open_file" data-args="{{ file.ref.origin.path.replace(meta.execution_dir, "") }}" data-label="Open Ref."></action>{% endif %}
15
+ </h2>
16
+ <!-- CONTENT -->
17
+ <div id="file_content_{{ loop.index }}" style="{% if not file.error and meta.config.collapse_if_successful %} display:none;{% endif %}">
18
+
19
+ <!--GENERAL ERROR-->
20
+ {% if file.error %}
21
+ <div>
22
+ <h3>Error</h3>
23
+ <span class="ERROR"><code>{{ file.error }}</code></span>
24
+ </div>
25
+ {% endif %}
26
+
27
+
28
+
29
+
30
+ <h3>Informations <action data-command="toogle" data-args="info_{{ (loop.index-1)|string }}"></action></h3>
31
+ <div id="info_{{ loop.index-1 }}">
32
+
33
+ <!--error_rule_patterns-->
34
+ {% if file.test.read_data and file.test.read_data.error_rule_patterns %}
35
+ <div>
36
+ <h4>Error pattern<action data-command="toogle" data-args="info_error_pattern_{{ (loop.index-1)|string }}"></action></h4>
37
+ <div id="info_error_pattern_{{ loop.index-1 }}">
38
+ <table>
39
+ <tr>
40
+ <th>Pattern</th>
41
+ <th>Found at lines</th>
42
+ </tr>
43
+ {% for item in file.test.read_data.error_rule_patterns.data %}
44
+ <tr>
45
+ <td class="test-bg-50">{{ item.pattern }}</td>
46
+ <td class="test-bg-20">{{ item.lines }}</td>
47
+ </tr>
48
+ {% endfor %}
49
+ </table>
50
+ </div>
51
+ </div>
52
+ {% endif %}
53
+
54
+ <!--ignore_lines-->
55
+ {% if file.test.ignore_lines or file.ref.ignore_lines %}
56
+ <div>
57
+ <h4>Ignoring lines <action data-command="toogle" data-args="info_ignore_{{ (loop.index-1)|string }}"></action></h4>
58
+ <div id="info_ignore_{{ loop.index-1 }}">
59
+ <table>
60
+ <tr>
61
+ <th>File</th>
62
+ <th>Patterns</th>
63
+ <th>Nb Found<h/th>
64
+ <th>Lines Found</th>
65
+ </tr>
66
+ <tr>
67
+ <td class="test-bg-50">Test</td>
68
+ <td class="test-bg-20">{{ file.test.ignore_patterns }}</td>
69
+ <td class="test-bg-20 number">{{ file.test.ignore_lines_number }}</td>
70
+ <td class="test-bg-20">{{ file.test.ignore_lines }}</td>
71
+ </tr>
72
+ <tr>
73
+ <td class="refe-bg-50">Ref.</td>
74
+ <td class="refe-bg-20">{{ file.ref.ignore_patterns }}</td>
75
+ <td class="refe-bg-20 number">{{ file.ref.ignore_lines_number }}</td>
76
+ <td class="refe-bg-20">{{ file.ref.ignore_lines }}</td>
77
+ </tr>
78
+ </table>
79
+ </div>
80
+ </div>
81
+ {% endif %}
82
+
83
+ {% if file.float_thresholds %}
84
+ <h4>Float Thresholds <action data-command="toogle" data-args="info_thresholds_{{ (loop.index-1)|string }}"></action></h4>
85
+ <div id="info_thresholds_{{ loop.index-1 }}">
86
+ <table>
87
+ <tr>
88
+ <th>Variable</th>
89
+ <th>Value</th>
90
+ </tr>
91
+ <tr><td>Threshold - Relative vs Absolute Error Min</td><td class="number">{{ file.float_thresholds.relative_vs_absolute_min }}</td></tr>
92
+ <tr><td>Threshold - Relative Error Min</td><td class="number">{{ file.float_thresholds.relative_error_min }}</td></tr>
93
+ <tr><td>Threshold - Relative Error Max</td><td class="number">{{ file.float_thresholds.relative_error_max }}</td></tr>
94
+ <tr><td>Threshold - Absolute Error Min</td><td class="number">{{ file.float_thresholds.absolute_error_min }}</td></tr>
95
+ <tr><td>Threshold - Absolute Error Max</td><td class="number">{{ file.float_thresholds.absolute_error_max }}</td></tr>
96
+ </table>
97
+ </div>
98
+ {% endif %}
99
+
100
+ </div>
101
+
102
+
103
+
104
+ {% if file.test %}
105
+
106
+ <!--CURVES-->
107
+ {% if file.test.curves %}
108
+ <h3>Curves <action data-command="toogle" data-args="curves_{{ (loop.index-1)|string }}"></action></h3>
109
+ <div id="curves_{{ loop.index-1 }}"></div>
110
+ {% endif %}
111
+
112
+ <!--ANIMATIONS-->
113
+ {% if file.test.animations %}
114
+ <h3>Animations <action data-command="toogle" data-args="animations_{{ loop.index|string }}"></action></h3>
115
+ <div id="animations_{{ loop.index }}" ></div>
116
+ {% endif %}
117
+
118
+ <!--img-->
119
+ {% if file.test.reader_category == "img" %}
120
+
121
+ <img class="img_reader" src="{{ file.name }}">
122
+ <img class="img_reader" src="../reference/{{ file.name }}">
123
+
124
+ {% endif %}
125
+
126
+
127
+ <!--FRAMESSERIES-->
128
+ {% if file.test.framesseries %}
129
+ <h3>Frames Series <action data-command="toogle" data-args="framesseries_{{ loop.index|string }}"></action></h3>
130
+ <div id="framesseries_{{ loop.index }}" ></div>
131
+ {% endif %}
132
+
133
+ <!--COMPARISONS ERRORS AND WARNINGS-->
134
+ {% if file.comparison_errors.error_nb or file.comparison_errors.warning_nb %}
135
+ <h3>Number Comparison Errors or Warnings <action data-command="toogle" data-args="numbers_errors_{{ loop.index|string }}"></action></h3>
136
+ <div id="numbers_errors_{{ loop.index }}" >
137
+ {% with file=file %}
138
+ {% include 'compare_13_section_numbers.html' %}
139
+ {% endwith %}
140
+ </div>
141
+ {% endif %}
142
+
143
+ {% endif %}
144
+
145
+ </div>
146
+
147
+ </section>
148
+
149
+ {% endif %}
150
+ {% endfor %}
@@ -0,0 +1,48 @@
1
+ <table>
2
+ <tr>
3
+ <th rowspan="2">Type</th>
4
+ <th rowspan="2">Message</th>
5
+ <th colspan="2">Value</th>
6
+ <th colspan="2">Line Number</th>
7
+ <th rowspan="2">Error</th>
8
+ <th rowspan="2">Visu</th>
9
+ <th colspan="2">Line(s)</th>
10
+ </tr>
11
+ <tr>
12
+ <th class="test-bg-50">Test</th>
13
+ <th class="refe-bg-50">Ref.</th>
14
+ <th class="test-bg-50">Test</th>
15
+ <th class="refe-bg-50">Ref.</th>
16
+ <th class="test-bg-50">Test</th>
17
+ <th class="refe-bg-50">Ref.</th>
18
+ </tr>
19
+
20
+
21
+ {% for error_type in [{"data_key": "errors", "class": "ERROR"}, {"data_key": "warnings", "class": "WARNING"}] %}
22
+ {% for item in file[error_type.data_key] %}
23
+ <tr>
24
+ <td class="{{error_type.class}}">{{error_type.class}}</td>
25
+ <td>{{ item.message }}</td>
26
+ <td class="number test-bg-20">{{ item.test }}</td>
27
+ <td class="number refe-bg-20">{{ item.reference }}</td>
28
+ <td class="number test-bg-20">{{ item.line_nb_1 }}</td>
29
+ <td class="number refe-bg-20">{{ item.line_nb_1 }}</td>
30
+ <td class="number">
31
+ {% if item.error_type == 'relative' %}{{ '%0.2f' % (item.error*100)|float}}%{% endif %}
32
+ {% if item.error_type == 'absolute' %}{{ item.error }}{% endif %}
33
+ </td>
34
+ <td>
35
+ {% if item.test and item.reference %}
36
+ <div style="width:200px;height:20px">
37
+ <div class="test-bg-80" style="width:{{100*(item.test|abs)/([(item.test|abs), (item.reference|abs)]|max)}}%;height:10px"></div>
38
+ <div class="refe-bg-80" style="width:{{100*(item.reference|abs)/([(item.test|abs), (item.reference|abs)]|max)}}%; height:10px"></div>
39
+ </div>
40
+ {% endif %}
41
+ </td>
42
+ <td class="test-bg-20"><pre>{{ item.line_1 }}</pre></td>
43
+ <td class="refe-bg-20"><pre>{{ item.line_2 }}</pre></td>
44
+ </tr>
45
+ {% endfor %}
46
+ {% endfor %}
47
+
48
+ </table>
@@ -0,0 +1,91 @@
1
+ {% set errs = file.comparison_errors %}
2
+ {% set c_type = file.comparison.type %}
3
+ <table>
4
+ <tr>
5
+ <th class="p-2" colspan="6">Error</th>
6
+ <th class="p-2" colspan="99">Source</th>
7
+ </tr>
8
+ <tr>
9
+ <th class="p-2" rowspan="2">Severity</th>
10
+ <th class="p-2" rowspan="2">Message</th>
11
+ <th class="p-2" colspan="2">Value</th>
12
+ <th class="p-2" rowspan="2">Error</th>
13
+ <th class="p-2" rowspan="2">Visu</th>
14
+
15
+ {% if c_type == "lines" %}
16
+ <th class="p-2" colspan="2">Line Number</th>
17
+ <th class="p-2" colspan="2">Line(s)</th>
18
+ {% endif %}
19
+
20
+ {% if c_type == "vectors" %}
21
+ <th class="p-2" rowspan="2">Column</th>
22
+ <th class="p-2" rowspan="2">Index</th>
23
+ <th class="p-2" rowspan="2">Info</th>
24
+ {% endif %}
25
+
26
+ </tr>
27
+ <tr>
28
+ <th class="p-2 test-bg-50">Test</th>
29
+ <th class="p-2 refe-bg-50">Ref.</th>
30
+
31
+ {% if c_type == "lines" %}
32
+ <th class="p-2 test-bg-50">Test</th>
33
+ <th class="p-2 refe-bg-50">Ref.</th>
34
+ <th class="p-2 test-bg-50">Test</th>
35
+ <th class="p-2 refe-bg-50">Ref.</th>
36
+ {% endif %}
37
+
38
+ </tr>
39
+
40
+
41
+ {% for error_type in [{"data_key": "error", "class": "ERROR"}, {"data_key": "warning", "class": "WARNING"}] %}
42
+ {% for item in errs[error_type.data_key] %}
43
+ <tr>
44
+
45
+ <td class="{{error_type.class}}">{{error_type.class}}</td>
46
+ <td>{{ errs.messages[item.msg] }}</td>
47
+
48
+ <!-- COMPARISON -->
49
+
50
+ <td class="number test-bg-20">{{ item.err.test }}</td>
51
+ <td class="number refe-bg-20">{{ item.err.reference }}</td>
52
+ <td class="number">
53
+ {% if item.err.is_relative %}
54
+ {{ '%0.2f' % (item.err.value*100)|float}}%
55
+ {% else %}
56
+ {{ item.err.value }}
57
+ {% endif %}
58
+ </td>
59
+ <td>
60
+ {% if item.err.test and item.err.reference %}
61
+ <div style="width:200px;height:20px">
62
+ <div class="test-bg-80" style="width:{{100*(item.err.test|abs)/([(item.err.test|abs), (item.err.reference|abs)]|max)}}%;height:10px"></div>
63
+ <div class="refe-bg-80" style="width:{{100*(item.err.reference|abs)/([(item.err.test|abs), (item.err.reference|abs)]|max)}}%; height:10px"></div>
64
+ </div>
65
+ {% endif %}
66
+ </td>
67
+
68
+
69
+ {% if c_type == "vectors" %}
70
+ {% set group = errs.groups[item.group] %}
71
+ <td>{{ group.name }}</td>
72
+ <td>{{ item.info.index }}</td>
73
+ <td>
74
+ {% if group.data %}
75
+ {{ group.data.info_prefix + ": " + item.info.info|string }}
76
+ {% endif %}
77
+ </td>
78
+ {% endif %}
79
+
80
+ {% if c_type == "lines" %}
81
+ <td class="test-bg-20 number">{{ item.info.line_nb_1 }}</td>
82
+ <td class="refe-bg-20 number">{{ item.info.line_nb_2 }}</td>
83
+ <td class="test-bg-20"><pre>{{ item.info.line_1 }}</pre></td>
84
+ <td class="refe-bg-20"><pre>{{ item.info.line_2 }}</pre></td>
85
+ {% endif %}
86
+
87
+ </tr>
88
+ {% endfor %}
89
+ {% endfor %}
90
+
91
+ </table>
@@ -0,0 +1,92 @@
1
+ {% macro but2(action) %}
2
+ <button onclick="{{ action }}" type="button" class="px-1 py-1 text-xs text-white bg-blue-700 rounded-lg hover:bg-blue-800">
3
+ Show/Hide
4
+ </button>
5
+ {% endmacro %}
6
+ {% macro but(action, content) %}
7
+ <button onclick="{{ action }}" type="button" class="text-xs rounded-lg">
8
+ {{ content }}
9
+ </button>
10
+ {% endmacro %}
11
+ {% set ns = namespace(statuses=['']) %}
12
+ {% for file in data.files %}
13
+ {% set ns.statuses = ns.statuses + ['SKIPPED' if file.skipped else ('ERROR' if file.error else ('WARNING' if file.comparison_errors.error_nb > 0 else 'SUCCESS'))] %}
14
+ {% endfor %}
15
+ <html>
16
+ <head>
17
+ <meta charset="utf-8"/>
18
+ <title id="head-title">{{ meta.title }} {{ data.name }}</title>
19
+ <!-- <script src="https://cdn.jsdelivr.net/npm/resemblejs@5.0.0/resemble.min.js"></script> -->
20
+ <script src="https://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js"></script>
21
+ <script src="https://cdn.plot.ly/plotly-2.34.0.min.js" charset="utf-8"></script>
22
+
23
+ <script>{% include 'js_com_dom.js' %}</script>
24
+ <script>{% include 'js_com_palette.js' %}</script>
25
+ <script>{% include 'js_com_page.js' with context %}</script>
26
+ <script>{% include 'js_chartlibs_plotly.js' %}</script>
27
+ <script>{% include 'js_chartlibs_echarts.js' %}</script>
28
+ <script>{% include 'js_curvemgr.js' %}</script>
29
+ <script>{% include 'utils_compare_report_anim.js' %}</script>
30
+ <script>{% include 'utils_compare_report_framesseries.js' %}</script>
31
+ <script>
32
+ function load_animations(){
33
+ // console.log(global_animations)
34
+ for (i in global_animations.test) {
35
+ const data_test = global_animations.test[i]
36
+ const data_ref = global_animations.reference[i]
37
+ // console.log(data_test)
38
+ const parent = dom.get("animations_"+(1+parseInt(i)))
39
+ if (data_test) {
40
+ for (j in data_test) {
41
+ dom.elt_p(parent,"h4",null,null,data_test.title)
42
+ const div = dom.elt_p(parent,"div")
43
+ Anim.create(div, data_test[j], data_ref[j])
44
+ }
45
+ // console.log(data_test)
46
+
47
+ }
48
+ }
49
+ }
50
+ </script>
51
+ <script>
52
+ function load_framesseries(){
53
+ for (i in global_framesseries.test) {
54
+ const data_test = global_framesseries.test[i]
55
+ const data_ref = global_framesseries.reference[i]
56
+ const parent = dom.get("framesseries_"+(1+parseInt(i)))
57
+ if (data_test) {
58
+ Framesseries.create(parent, data_test, data_ref)
59
+ }
60
+ }
61
+ }
62
+ </script>
63
+ <style type="text/css">{% include 'style.css' %}</style>
64
+ <style type="text/css">
65
+ .noselect {
66
+ -webkit-user-select: none; /* Safari */
67
+ -ms-user-select: none; /* IE 10 and IE 11 */
68
+ user-select: none; /* Standard syntax */
69
+ }
70
+ </style>
71
+ </head>
72
+ <body>
73
+ {% include 'body_01_title.html' with context %}
74
+
75
+ {% include 'compare_11_summary.html' with context %}
76
+ {% include 'compare_12_sections.html' with context %}
77
+
78
+ {% include 'body_99_footer.html' with context %}
79
+ <script type="text/javascript">
80
+ const GLOBAL_CONFIG = {{ meta.config_json }};
81
+ actions.init_page();
82
+ </script>
83
+ <script type="text/javascript">
84
+ const global_curves = {
85
+ test : [ {% for file in data.files %} {{ file.test.curves or 'null' }} , {% endfor %} ],
86
+ reference : [ {% for file in data.files %} {{ file.ref.curves or 'null' }} , {% endfor %} ],
87
+ }
88
+ curvemgr.init(GLOBAL_CONFIG['curves']);
89
+ </script>
90
+
91
+ </body>
92
+ </html>
@@ -0,0 +1,34 @@
1
+ ((w_1, undef) => {
2
+ //
3
+ const obj = {
4
+ add: function(elt, data) {
5
+ const echarts_options = {
6
+ //color: null, // Custom color palette
7
+ legend: { left: 'right' },
8
+ tooltip: { trigger: 'item', formatter: '{a}<br/>{b}<br/>{c}' },
9
+ title: { text: data.title },
10
+ xAxis: { name: data.xaxis },
11
+ yAxis: { name: data.yaxis },
12
+ series: [],
13
+ }
14
+ // series
15
+ data.series.forEach(item => {
16
+ echarts_options.series.push({
17
+ type: 'line',
18
+ name: item.name,
19
+ data: item.data,
20
+ })
21
+ });
22
+ // colors
23
+ if (data.series[0].color) {
24
+ echarts_options.color = data.series.map((e) => e.color)
25
+ }
26
+ // create
27
+ echarts.init(elt).setOption(echarts_options);
28
+ },
29
+ };
30
+ // global
31
+ if(w_1.chartlibs === undef) w_1.chartlibs = {};
32
+ w_1.chartlibs.echarts = obj;
33
+ //
34
+ })(window);
@@ -0,0 +1,55 @@
1
+ ((window1, undefined) => {
2
+ //
3
+ const plotly = {
4
+ add: function(elt, meta, items) {
5
+ const series = []
6
+ items.forEach(item => {
7
+ series.push({
8
+ name: item.name,
9
+ x: item.x_data,
10
+ y: item.y_data,
11
+ // mode: 'lines+markers',
12
+ mode: 'lines',
13
+ line: { color: item.color, width: 3 },
14
+ marker: { color: item.color, size: 6 },
15
+ })
16
+ });
17
+ Plotly.newPlot(
18
+ elt,
19
+ series,
20
+ {
21
+ title: { text: meta.title, font: { weight: 800 } },
22
+ xaxis: { title: meta.xaxis },
23
+ yaxis: { title: meta.yaxis },
24
+ autosize: true,
25
+ // showlegend: false,
26
+ // legend: {
27
+ // x: 1,
28
+ // xanchor: 'right',
29
+ // y: 1
30
+ // }
31
+ // margin: {
32
+ // l: 10,
33
+ // r: 10,
34
+ // b: 10,
35
+ // t: 10,
36
+ // pad: 0,
37
+ // },
38
+ }
39
+ );
40
+ },
41
+ add_ys: function(elt, meta, x_data, y_items) {
42
+ this.add(elt, meta, y_items.map((item) => {return {name: item.name, color: item.color, x_data: x_data, y_data: item.data} } ))
43
+ },
44
+ upd_y: function(elt, y_index, y_data) {
45
+ Plotly.restyle(elt, { 'y': [y_data] }, [y_index]);
46
+ },
47
+ upd_y_all: function(elt, y_data_arr) {
48
+ Plotly.restyle(elt, { 'y': y_data_arr });
49
+ },
50
+ };
51
+ // global
52
+ if(window1.chartlibs === undefined) window1.chartlibs = {};
53
+ window1.chartlibs.plotly = plotly;
54
+ //
55
+ })(window);
@@ -0,0 +1,21 @@
1
+ const dom = {
2
+ get: function(id) { return document.getElementById(id) },
3
+ q(sel) { return document.querySelectorAll(sel); },
4
+ qc(e, sel) { return e.querySelectorAll(sel); },
5
+ elt(tag,style,attrs,html) { const e = document.createElement(tag); e.style.cssText = style; if (attrs) { for (const k in attrs) { e.setAttribute(k, attrs[k]);}}; if (html) e.innerHTML=html; return e; },
6
+ elt_p(parent,tag,style,attrs,html) { const e = this.elt(tag,style,attrs,html); if (parent) parent.appendChild(e); return e; },
7
+ div(style,attrs,html) { return this.elt('div',style,attrs,html); },
8
+ div_p(parent,style,attrs,html) { return this.elt_p(parent,'div',style,attrs,html); },
9
+ tree(parent, data, out) {
10
+ if (!data) return;
11
+ const e = this.elt_p(parent, data.tag, data.style, data.attrs, data.html);
12
+ if (data.out) out[data.out] = e;
13
+ if (data.children) {
14
+ for (const i in data.children) { this.tree(e, data.children[i], out) }
15
+ }
16
+ if (data.click) e.addEventListener("click", data.click);
17
+ },
18
+ tree_o(parent, data) { const out={} ; this.tree(parent, data, out); return out; },
19
+ getRadio(form,name) { return document.forms[form].elements[name].value },
20
+ toogle(e) { e.style.display = (e.style.display === "none") ? "" : "none" },
21
+ }