scilens 0.4.5__py3-none-any.whl → 0.4.6__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.
- scilens/config/models/reader_format_txt_fixed_cols.py +2 -1
- scilens/readers/reader_txt_fixed_cols.py +4 -2
- scilens/report/templates/compare_12_sections.html +1 -8
- scilens/report/templates/compare_13_section_images.html +26 -0
- scilens/report/templates/index.html +2 -0
- scilens/report/templates/js_images.js +55 -0
- scilens/report/templates/style.css +8 -1
- {scilens-0.4.5.dist-info → scilens-0.4.6.dist-info}/METADATA +1 -1
- {scilens-0.4.5.dist-info → scilens-0.4.6.dist-info}/RECORD +11 -9
- {scilens-0.4.5.dist-info → scilens-0.4.6.dist-info}/WHEEL +0 -0
- {scilens-0.4.5.dist-info → scilens-0.4.6.dist-info}/entry_points.txt +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
_A=None
|
|
2
2
|
from pydantic import BaseModel,Field
|
|
3
3
|
from scilens.config.models.reader_format_cols import ReaderColsCurveParserConfig,ReaderColsConfig
|
|
4
|
-
|
|
4
|
+
from scilens.config.models.reader_metrics import ReaderColsMetricsConfig
|
|
5
|
+
class ReaderTxtFixedColsConfig(BaseModel,extra='forbid'):column_widths:list[int]|_A=Field(default=_A,description='Liste des largeurs de colonnes. Ex: [9, 13, 12]. Exclusif avec `column_indexes`.');column_indexes:list[tuple[int,int]]|_A=Field(default=_A,description='Liste des index de début et fin de colonnes. Ex: [[0, 8], [9, 12], [13, 28]]. Exclusif avec `column_widths`.');cols:ReaderColsConfig|_A=Field(default=_A,description='Configuration des colonnes. (Valide seulement si non matrice)');metrics:list['ReaderColsMetricsConfig']|_A=Field(default=_A,description='Liste des métriques à calculer pour les colonnes. (Valide seulement si non matrice)');has_header:bool=Field(default=False,description="Indique si le dataset contient une ligne d'entête.");has_header_line:int|_A=Field(default=_A,description="Numéro de la ligne d'entête. Si None, la première ligne non ignorée est considérée comme l'entête.");has_header_ignore:list[str]|_A=Field(default=_A,description="Chaînes de caractères à ignorer dans la ligne d'entête. eex: ['##', '|'].");curve_parser:ReaderColsCurveParserConfig|_A=Field(default=_A,description='Parseur de courbe à utiliser.')
|
|
@@ -77,7 +77,9 @@ class ReaderTxtFixedCols(ReaderInterface):
|
|
|
77
77
|
if F.ori_line_idx==H-1:continue
|
|
78
78
|
for(R,O)in enumerate(E):S=N[O[0]:O[1]].strip();T=string_2_float(S);C.data[R].append(T)
|
|
79
79
|
C.origin_line_nb.append(H)
|
|
80
|
-
C.rows_count=len(C.origin_line_nb);L.close();A.cols_dataset=C;A.raw_lines_number=H;A.
|
|
80
|
+
C.rows_count=len(C.origin_line_nb);L.close();A.cols_dataset=C;A.raw_lines_number=H;A.metrics=_A
|
|
81
|
+
if B.metrics:A.metrics=C.compute_metrics(B.metrics)
|
|
82
|
+
A.curves=_A;A.cols_curve=_A
|
|
81
83
|
if B.cols and B.cols.curve_parser:
|
|
82
84
|
if B.cols.curve_parser.name==ReaderCurveParserNameConfig.COL_X:
|
|
83
85
|
A.curves,U=C.get_curves_col_x(B.cols.curve_parser.parameters.x)
|
|
@@ -85,4 +87,4 @@ class ReaderTxtFixedCols(ReaderInterface):
|
|
|
85
87
|
elif B.cols.curve_parser.name==ReaderCurveParserNameConfig.COLS_COUPLE:raise NotImplementedError('cols_couple not implemented')
|
|
86
88
|
else:raise Exception('Curve parser not supported.')
|
|
87
89
|
def compare(A,compare_floats,param_reader,param_is_ref=True):D=param_is_ref;C=param_reader;B=compare_floats;E=A.cols_dataset if D else C.cols_dataset;F=A.cols_dataset if not D else C.cols_dataset;G=A.cols_curve;I,H=B.compare_errors.add_group('node','txt cols');return compare(H,B,E,F,G)
|
|
88
|
-
def class_info(A):return{'cols':A.cols_dataset.names,'raw_lines_number':A.raw_lines_number,'curves':A.curves}
|
|
90
|
+
def class_info(A):return{'cols':A.cols_dataset.names,'raw_lines_number':A.raw_lines_number,'curves':A.curves,'metrics':A.metrics}
|
|
@@ -29,14 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
{% if file.test.reader == 'ReaderImg' %}
|
|
32
|
-
|
|
33
|
-
{% set img_ref = file.ref.origin.path.replace(meta.execution_dir, "") %}
|
|
34
|
-
|
|
35
|
-
<div>
|
|
36
|
-
<h3>Images</h3>
|
|
37
|
-
<img class="img_reader" src="{{ img_test[1:] if img_test.startswith('/') else img_test }}">
|
|
38
|
-
<img class="img_reader" src="{{ img_ref[1:] if img_ref.startswith('/') else img_ref }}">
|
|
39
|
-
</div>
|
|
32
|
+
{% include 'compare_13_section_images.html' %}
|
|
40
33
|
{% endif %}
|
|
41
34
|
|
|
42
35
|
<h3>Informations <action data-command="toogle" data-args="info_{{ (file_index-1)|string }}"></action></h3>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{% set img_test = file.test.origin.path.replace(meta.execution_dir, "") %}
|
|
2
|
+
{% set img_ref = file.ref.origin.path.replace(meta.execution_dir, "") %}
|
|
3
|
+
{% set img_w = file.test.reader_info.width %}
|
|
4
|
+
{% set img_h = file.test.reader_info.height %}
|
|
5
|
+
{% set style = "width: 200px; height: 80px;" %}
|
|
6
|
+
|
|
7
|
+
<div>
|
|
8
|
+
<h3>Images</h3>
|
|
9
|
+
<div>
|
|
10
|
+
<div class="m-1 shadow-lg widget-container">
|
|
11
|
+
<div>Test</div>
|
|
12
|
+
<img class="img_reader" src="{{ img_test[1:] if img_test.startswith('/') else img_test }}">
|
|
13
|
+
</div>
|
|
14
|
+
<div class="m-1 shadow-lg widget-container">
|
|
15
|
+
<div>Reference</div>
|
|
16
|
+
<img class="img_reader" src="{{ img_ref[1:] if img_ref.startswith('/') else img_ref }}">
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
{% if file.comparison.diff_image %}
|
|
20
|
+
<div class="m-1 shadow-lg widget-container">
|
|
21
|
+
<div>Diff.</div>
|
|
22
|
+
<img style="display:none" class="sl-diff-image" src="{{ file.comparison.diff_image.data }}">
|
|
23
|
+
</div>
|
|
24
|
+
{% endif %}
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
{% include 'models.js' %}
|
|
33
33
|
{% include 'js_dom.js' %}
|
|
34
34
|
{% include 'js_palette.js' %}
|
|
35
|
+
{% include 'js_images.js' %}
|
|
35
36
|
|
|
36
37
|
{% include 'js_com_page.js' with context %}
|
|
37
38
|
{% include 'uti_widget.js' with context %}
|
|
@@ -121,6 +122,7 @@ function load_file_section(global_var, section_prefix, cls) {
|
|
|
121
122
|
const GLOBAL_VARS = {};
|
|
122
123
|
const GLOBAL_CONFIG = {{ meta.config_json }};
|
|
123
124
|
actions.init_page();
|
|
125
|
+
if (SLImages) SLImages.init();
|
|
124
126
|
</script>
|
|
125
127
|
<script type="text/javascript">
|
|
126
128
|
const global_curves = {
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
((w_1, undef) => {
|
|
2
|
+
|
|
3
|
+
function get_img_data(img) {
|
|
4
|
+
const width = img.width;
|
|
5
|
+
const height = img.height;
|
|
6
|
+
const canvas = document.createElement("canvas");
|
|
7
|
+
canvas.width = width;
|
|
8
|
+
canvas.height = height;
|
|
9
|
+
const ctx = canvas.getContext("2d");
|
|
10
|
+
ctx.drawImage(img, 0, 0);
|
|
11
|
+
return ctx.getImageData(0, 0, width, height).data;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const SLImages = {
|
|
15
|
+
init: function() {
|
|
16
|
+
const nodes = dom.q(document.body, ".sl-diff-image");
|
|
17
|
+
for (const img of nodes) {
|
|
18
|
+
|
|
19
|
+
const threshold = 0;
|
|
20
|
+
|
|
21
|
+
const width = img.width;
|
|
22
|
+
const height = img.height;
|
|
23
|
+
const canvas = dom.elt_p(img.parentNode,"canvas",null,{width:width,height:height,class:"img_reader"})
|
|
24
|
+
const comp_ctx = canvas.getContext("2d");
|
|
25
|
+
const comp_data = comp_ctx.createImageData(width, height);
|
|
26
|
+
|
|
27
|
+
const img_data = get_img_data(img);
|
|
28
|
+
|
|
29
|
+
for (let i = 0; i < img_data.length; i += 4) {
|
|
30
|
+
// channels
|
|
31
|
+
const c_r = img_data[i];
|
|
32
|
+
const c_g = img_data[i + 1];
|
|
33
|
+
const c_b = img_data[i + 2];
|
|
34
|
+
// diff total
|
|
35
|
+
const diff = (c_r + c_g + c_b) / 3;
|
|
36
|
+
// if (c_r != 0 || c_g != 0 || c_b != 0) {
|
|
37
|
+
if (diff > threshold) {
|
|
38
|
+
comp_data.data[i] = 255; // Rouge
|
|
39
|
+
comp_data.data[i + 1] = 0;
|
|
40
|
+
comp_data.data[i + 2] = 0;
|
|
41
|
+
comp_data.data[i + 3] = 255;
|
|
42
|
+
} else {
|
|
43
|
+
comp_data.data[i] = 255; // Blanc
|
|
44
|
+
comp_data.data[i + 1] = 255;
|
|
45
|
+
comp_data.data[i + 2] = 255;
|
|
46
|
+
comp_data.data[i + 3] = 255;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
comp_ctx.putImageData(comp_data, 0, 0);
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
w_1.SLImages = SLImages;
|
|
54
|
+
|
|
55
|
+
})(window);
|
|
@@ -27,7 +27,11 @@ color:#999999;
|
|
|
27
27
|
font-size:0.9rem;
|
|
28
28
|
border: 1px #999999 solid;
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
.widget-container {
|
|
31
|
+
display: inline-block;
|
|
32
|
+
font-weight: bold;
|
|
33
|
+
text-align: center;
|
|
34
|
+
}
|
|
31
35
|
.inset {
|
|
32
36
|
border-style: inset;
|
|
33
37
|
|
|
@@ -102,6 +106,9 @@ max-height: 400px;
|
|
|
102
106
|
/* tailwind like */
|
|
103
107
|
button {border: 0;user-select: none; /* Standard syntax */ cursor: pointer;}
|
|
104
108
|
|
|
109
|
+
|
|
110
|
+
.invisible {visibility: hidden;}
|
|
111
|
+
|
|
105
112
|
.text-white { color: rgb(255 255 255); }
|
|
106
113
|
|
|
107
114
|
.text-xs { font-size: .75rem; line-height: 1rem; }
|
|
@@ -31,7 +31,7 @@ scilens/config/models/reader_format_cols.py,sha256=-nvPjZImao_RFVAlyvTZG1fCXa3hh
|
|
|
31
31
|
scilens/config/models/reader_format_csv.py,sha256=KWEH0c12n6hdaWAKdHXYMT5SvH4UqBFvP7d3ZkJr7r8,1620
|
|
32
32
|
scilens/config/models/reader_format_netcdf.py,sha256=Skr5lZACqVRrrlvs7R1RVFBpMTDthLJN-Fbs24jtb7o,1271
|
|
33
33
|
scilens/config/models/reader_format_txt.py,sha256=35rvhg311DN9miE47QM9NN_gcZHglYG2lBZPLJy4iyg,1462
|
|
34
|
-
scilens/config/models/reader_format_txt_fixed_cols.py,sha256=
|
|
34
|
+
scilens/config/models/reader_format_txt_fixed_cols.py,sha256=XmmFS0LdGR81XCjJIyW4cngivFo_8drckqe_k8fhqJk,1385
|
|
35
35
|
scilens/config/models/reader_metrics.py,sha256=qJBnq6gix-vkNeCz7LuVu04n8q6Rx1KUmkqy-J6BCDY,900
|
|
36
36
|
scilens/config/models/readers.py,sha256=NpEjXbLv11k9N8UsnuS55KEYlRijF9C3eOrI0SB9dqM,1723
|
|
37
37
|
scilens/config/models/report.py,sha256=_4W96v5izWCC_CrMzh3PM0mZIUAa3L26ZQqjV0Mv0f4,1008
|
|
@@ -56,7 +56,7 @@ scilens/readers/reader_csv.py,sha256=5TQ9TAVSNUje7Mbqy9T1SfJ1f4Ic_bFBTD9S5OuMrGU
|
|
|
56
56
|
scilens/readers/reader_interface.py,sha256=r1pu9LyweTGXU8YfI3FPZy1Em4stzmJb-6j90j1tPQQ,938
|
|
57
57
|
scilens/readers/reader_manager.py,sha256=DFinxIk3IIIcB6JxybGcv-mXt3jhXgCwUtzR0TqhB2Q,2684
|
|
58
58
|
scilens/readers/reader_txt.py,sha256=U3hGIorj-Nv-jq6zYtvbDv2LQBHTgW52PHbV8A5FMA8,4526
|
|
59
|
-
scilens/readers/reader_txt_fixed_cols.py,sha256=
|
|
59
|
+
scilens/readers/reader_txt_fixed_cols.py,sha256=uVzcblWlfsdBZzboPXtsWC9H3jSNjfMp87pUkqnW3sE,4617
|
|
60
60
|
scilens/readers/transform.py,sha256=kppfgPkXymF0qtquFivuosLVfF66L9bE-wGx-3bMHv8,307
|
|
61
61
|
scilens/report/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
62
62
|
scilens/report/assets/logo.svg,sha256=W-1OVqcvdBjf-1AHHcV6WciIUqBoVFUh52Tc3o_jqtA,4519
|
|
@@ -72,21 +72,23 @@ scilens/report/templates/compare_11_summary.html,sha256=Goknx4slzt8JX2rq05hf31HT
|
|
|
72
72
|
scilens/report/templates/compare_11_summary_datasets.html,sha256=iUhOhZpAc4yLsHqDinx30xQDjLcbXRXU72Ud6n29GBQ,3495
|
|
73
73
|
scilens/report/templates/compare_11_summary_metrics copy.html,sha256=y8hfw8W5GXR7CRDEmlgk_IN100gfF3-67UqvAIMrxPA,623
|
|
74
74
|
scilens/report/templates/compare_11_summary_metrics.html,sha256=2qi2ME6VrV68mxnTZq3zS-GEPc5vwhFgswswXEpt_34,966
|
|
75
|
-
scilens/report/templates/compare_12_sections.html,sha256=
|
|
75
|
+
scilens/report/templates/compare_12_sections.html,sha256=D2_T0GVy2ntRl92ih2ZrRCduHDzuprq5v6i6Ey5MYXA,6311
|
|
76
|
+
scilens/report/templates/compare_13_section_images.html,sha256=8z6gwsw6-eCFGb0quEq2WRFfykg-8b1msvTA1vftxS4,945
|
|
76
77
|
scilens/report/templates/compare_13_section_numbers copy.html,sha256=0PWK_I2kNX3LjPLkkY4eSYIeB7YFkA28nk-PPLDhnaY,1753
|
|
77
78
|
scilens/report/templates/compare_13_section_numbers.html,sha256=9etEMSqwrDyJIn_nMbKEVaDgnFL_hBxSjPR-hU2wgDI,851
|
|
78
79
|
scilens/report/templates/compare_13_section_numbers_table.html,sha256=pME7vkcPpP2YF0X_jPeD8hEyjA4i-11slfwuQkfUNNI,2927
|
|
79
80
|
scilens/report/templates/html_macros.html,sha256=jKatNSn4nX_72_wHl0-0dhxZZZBoGDGpOg7E7TMZSGs,1185
|
|
80
81
|
scilens/report/templates/html_widget_err.html,sha256=sjbtooSh7RGFs8kcct4_tMi_n8FQiaoqRhUjBzHduZM,336
|
|
81
|
-
scilens/report/templates/index.html,sha256=
|
|
82
|
+
scilens/report/templates/index.html,sha256=lb02RQXDOrigieeFBBJewqRUTw_mwcmVgsibM1eUN_I,6077
|
|
82
83
|
scilens/report/templates/js_chartlibs_echarts.js,sha256=6YicVhTNIBmmBpV31XCVN5oBeiD0t29JIosJZRUv01M,907
|
|
83
84
|
scilens/report/templates/js_chartlibs_plotly.js,sha256=MQGpYtBc1gKtu98BcfVOx_W0TktABqanxDjK9YaVqNE,2649
|
|
84
85
|
scilens/report/templates/js_com_page.js,sha256=miSPJuzb5hD6sX7b5RYMWoCv9pg2CraHuIfXVFYmUU8,6922
|
|
85
86
|
scilens/report/templates/js_curvemgr.js,sha256=gnRLO6HbZOMLIBQKjVhV2PciqXtuNKxpGx4boijV2Qc,12175
|
|
86
87
|
scilens/report/templates/js_dom.js,sha256=r5fNSEdeHopMUjSaYtuAIBNRhvSIPoQ9HzAtxvLZcuk,1363
|
|
88
|
+
scilens/report/templates/js_images.js,sha256=Welcp1ouZdyhE6EyJiiRdPE0VCZjh5dRwgfjMMHmx18,1624
|
|
87
89
|
scilens/report/templates/js_palette.js,sha256=HeewAmkR67QiqXSanJS3cCgp6IPKomlULUTKt55F6es,218
|
|
88
90
|
scilens/report/templates/models.js,sha256=MrgnVxPnoimLbR_Eb7Rq3OoNlT89m4PYk6vqt-D7KyY,715
|
|
89
|
-
scilens/report/templates/style.css,sha256=
|
|
91
|
+
scilens/report/templates/style.css,sha256=_p5wrk-xeIC7-STthrS6OxViYUvJdVE3CKudepCU4Z8,5577
|
|
90
92
|
scilens/report/templates/uti_frameseries.js,sha256=2edOgmgEfD9F7wYvcB1ZAELnLRq43tcxYMhERnNC5NY,6282
|
|
91
93
|
scilens/report/templates/uti_matrix.js,sha256=wD9vZ9aMq897XupXDmGYkiUQl8behMAYDjcfDvxGwQ0,3441
|
|
92
94
|
scilens/report/templates/uti_spectrograms.js,sha256=qE2wdit6Zq8AxShtV9FdA2pRTk4KY9zZUZ58ccYj_Ow,4311
|
|
@@ -111,7 +113,7 @@ scilens/utils/template.py,sha256=9dlXX3nmfzDRUwzPJOkoxk15UXivZ2SW-McdCwokFa4,443
|
|
|
111
113
|
scilens/utils/time_tracker.py,sha256=DdVBoMpVLXrX0qZZXyLm4g38EwDVLlRcBqcpNex1mYY,545
|
|
112
114
|
scilens/utils/vectors.py,sha256=4N2BZSC5n3HgZqPujDGF5NdjVmSL1rOHb_qw4OoABQY,103
|
|
113
115
|
scilens/utils/web.py,sha256=MAFWpIFOKz7QhqDoFh-Qwstvc76KpcxstSgHFT8FOL4,901
|
|
114
|
-
scilens-0.4.
|
|
115
|
-
scilens-0.4.
|
|
116
|
-
scilens-0.4.
|
|
117
|
-
scilens-0.4.
|
|
116
|
+
scilens-0.4.6.dist-info/METADATA,sha256=3W-u6m5qT_81k7TXSNJqbf4RgQOHt2Sj0NQBiJqnS9o,1367
|
|
117
|
+
scilens-0.4.6.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
118
|
+
scilens-0.4.6.dist-info/entry_points.txt,sha256=DaKGgxUEUv34GJAoXtta6ecL37ercejep9sCSSRQK2s,48
|
|
119
|
+
scilens-0.4.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|