scilens 0.4.4__py3-none-any.whl → 0.4.5__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/components/compare_2_files.py +26 -25
- scilens/components/compare_models.py +1 -1
- scilens/readers/reader_interface.py +2 -2
- scilens/report/templates/compare_12_sections.html +9 -8
- {scilens-0.4.4.dist-info → scilens-0.4.5.dist-info}/METADATA +1 -1
- {scilens-0.4.4.dist-info → scilens-0.4.5.dist-info}/RECORD +8 -8
- {scilens-0.4.4.dist-info → scilens-0.4.5.dist-info}/WHEEL +0 -0
- {scilens-0.4.4.dist-info → scilens-0.4.5.dist-info}/entry_points.txt +0 -0
|
@@ -8,38 +8,39 @@ from scilens.components.compare_floats import CompareFloats
|
|
|
8
8
|
class Compare2Files:
|
|
9
9
|
def __init__(A,context):A.context=context
|
|
10
10
|
def compare(B,path_test,path_ref):
|
|
11
|
-
|
|
12
|
-
for(C,
|
|
13
|
-
if not
|
|
11
|
+
i='status';h='severity';g='comparison_errors';f='comparison';Y=path_ref;X=path_test;W='err_index';V='reader';U='skipped';T=None;R='metrics';Q='error';P=True;O='ref';K='path';J='test';A={J:{},O:{},f:T,g:T};H={J:{K:X},O:{K:Y}};S=B.context.config.compare.sources.not_matching_source_ignore_pattern
|
|
12
|
+
for(C,L)in H.items():
|
|
13
|
+
if not L.get(K)or not os.path.exists(L[K]):
|
|
14
14
|
if S:
|
|
15
15
|
if S=='*':A[U]=P;return A
|
|
16
16
|
else:
|
|
17
|
-
|
|
18
|
-
if
|
|
17
|
+
j=os.path.basename(Y if C==J else X);k=re.search(S,j)
|
|
18
|
+
if k:A[U]=P;return A
|
|
19
19
|
A[Q]=f"file {C} does not exist";return A
|
|
20
|
-
|
|
21
|
-
for(C,
|
|
22
|
-
D=H[
|
|
20
|
+
l=FileReader(B.context.working_dir,B.context.config.file_reader,B.context.config.readers,config_alternate_path=B.context.origin_working_dir)
|
|
21
|
+
for(C,L)in H.items():H[C][V]=l.read(L[K])
|
|
22
|
+
D=H[J][V];F=H[O][V]
|
|
23
23
|
if not D or not F:A[U]=P;return A
|
|
24
|
-
A[
|
|
24
|
+
A[J]=D.info();A[O]=F.info()
|
|
25
25
|
if D.read_error:A[Q]=D.read_error;return A
|
|
26
|
-
E=CompareErrors(B.context.config.compare.errors_limit,B.context.config.compare.ignore_warnings);Z=CompareFloats(E,B.context.config.compare.float_thresholds);D.compare(Z,F,param_is_ref=P);G=E.root_group;
|
|
26
|
+
E=CompareErrors(B.context.config.compare.errors_limit,B.context.config.compare.ignore_warnings);Z=CompareFloats(E,B.context.config.compare.float_thresholds);a=D.compare(Z,F,param_is_ref=P);G=E.root_group;M=T
|
|
27
27
|
if B.context.config.compare.metrics_compare and(D.metrics or F.metrics):
|
|
28
|
-
|
|
29
|
-
if B.context.config.compare.metrics_thresholds:
|
|
30
|
-
else:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if G.info:
|
|
34
|
-
if
|
|
28
|
+
o,M=E.add_group(R,R,parent=G)
|
|
29
|
+
if B.context.config.compare.metrics_thresholds:b=CompareFloats(E,B.context.config.compare.metrics_thresholds)
|
|
30
|
+
else:b=Z
|
|
31
|
+
b.compare_dicts(D.metrics,F.metrics,M)
|
|
32
|
+
I={'total_diffs':G.total_diffs}
|
|
33
|
+
if G.info:I.update(G.info)
|
|
34
|
+
if a:I.update(a)
|
|
35
|
+
if M:
|
|
35
36
|
N={}
|
|
36
|
-
for
|
|
37
|
-
for(
|
|
38
|
-
if
|
|
39
|
-
|
|
40
|
-
for C in D.metrics.keys():
|
|
41
|
-
A[
|
|
37
|
+
for c in[SEVERITY_ERROR,SEVERITY_WARNING]:
|
|
38
|
+
for(m,d)in enumerate(E.errors[c]):
|
|
39
|
+
if d.group==M.id:N[d.info['key']]={h:c,W:m}
|
|
40
|
+
I[R]={}
|
|
41
|
+
for C in D.metrics.keys():I[R][C]={i:N[C][h],W:N[C][W]}if C in N else{i:'success'}
|
|
42
|
+
A[f]=I;A[g]=E.get_data()
|
|
42
43
|
if G.error:A[Q]=G.error;return A
|
|
43
|
-
D.close();F.close();
|
|
44
|
-
if
|
|
44
|
+
D.close();F.close();e=len(E.errors[SEVERITY_ERROR])
|
|
45
|
+
if e>0:n=f"{e} comparison errors";A[Q]=n
|
|
45
46
|
return A
|
|
@@ -9,7 +9,7 @@ class CompareFloatsErr:is_relative:bool;value:float;test:float|_A=_A;reference:f
|
|
|
9
9
|
@dataclass
|
|
10
10
|
class Compare2ValuesResults:severity:str;message:str;comp_err:CompareFloatsErr|_A=_A
|
|
11
11
|
class CompareErr(BaseModel):err:CompareFloatsErr|_A;msg:int;group:int|_A=_A;info:dict|_A=_A
|
|
12
|
-
COMPARE_GROUP_TYPE=Literal['node','lines','vectors',' matrix','metrics']
|
|
12
|
+
COMPARE_GROUP_TYPE=Literal['node','lines','vectors',' matrix','metrics','pixels']
|
|
13
13
|
@dataclass
|
|
14
14
|
class CompareGroup:
|
|
15
15
|
id:int;type:COMPARE_GROUP_TYPE;name:str;parent:Optional['CompareGroup']=_A;error:str|_A=_A;total_diffs:int=0;total_warnings:int=0;total_errors:int=0;data:dict|_A=_A;info:dict|_A=_A
|
|
@@ -6,10 +6,10 @@ class ReaderInterface(ABC):
|
|
|
6
6
|
@property
|
|
7
7
|
@abstractmethod
|
|
8
8
|
def category(self):0
|
|
9
|
-
def __init__(A,origin,name='',encoding='',curve_parser=None):A.origin=origin;A.name=name;A.encoding=encoding or'utf-8';A.curve_parser=curve_parser;A.read_error=None;A.read_data={}
|
|
9
|
+
def __init__(A,origin,name='',encoding='',curve_parser=None):A.origin=origin;A.name=name;A.encoding=encoding or'utf-8';A.curve_parser=curve_parser;A.read_error=None;A.read_data={};A.reader_info={}
|
|
10
10
|
def read(A,reader_options=None):raise NotImplementedError(_A)
|
|
11
11
|
def compare(A,reader,param_is_ref=True):raise NotImplementedError(_A)
|
|
12
12
|
def get_raw_lines(A,line_nb,pre=0,post=0):raise NotImplementedError(_A)
|
|
13
13
|
def class_info(A):raise NotImplementedError(_A)
|
|
14
14
|
def close(A):0
|
|
15
|
-
def info(A):B={'reader':A.__class__.__name__,'
|
|
15
|
+
def info(A):B={'reader':A.__class__.__name__,'reader_info':A.reader_info,'name':A.name,'origin':A.origin.dict(),'encoding':A.encoding,'read_error':A.read_error,'read_data':A.read_data};B.update(A.class_info());return B
|
|
@@ -28,7 +28,16 @@
|
|
|
28
28
|
{% endif %}
|
|
29
29
|
|
|
30
30
|
|
|
31
|
+
{% if file.test.reader == 'ReaderImg' %}
|
|
32
|
+
{% set img_test = file.test.origin.path.replace(meta.execution_dir, "") %}
|
|
33
|
+
{% set img_ref = file.ref.origin.path.replace(meta.execution_dir, "") %}
|
|
31
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>
|
|
40
|
+
{% endif %}
|
|
32
41
|
|
|
33
42
|
<h3>Informations <action data-command="toogle" data-args="info_{{ (file_index-1)|string }}"></action></h3>
|
|
34
43
|
<div id="info_{{ file_index-1 }}">
|
|
@@ -118,14 +127,6 @@
|
|
|
118
127
|
<div id="animations_{{ file_index }}" ></div>
|
|
119
128
|
{% endif %}
|
|
120
129
|
|
|
121
|
-
<!--img-->
|
|
122
|
-
{% if file.test.reader_category == "img" %}
|
|
123
|
-
|
|
124
|
-
<img class="img_reader" src="{{ file.name }}">
|
|
125
|
-
<img class="img_reader" src="../reference/{{ file.name }}">
|
|
126
|
-
|
|
127
|
-
{% endif %}
|
|
128
|
-
|
|
129
130
|
|
|
130
131
|
<!--FRAMESSERIES-->
|
|
131
132
|
{% if file.test.framesseries %}
|
|
@@ -8,11 +8,11 @@ scilens/cli/info.py,sha256=xE7q9epjrCQRL6Agi3nhKsG6Mr3B8HSUFMti-epMoXA,1929
|
|
|
8
8
|
scilens/cli/main.py,sha256=C8EWm6JfTBBH74pR3J-O2ZuPX78VcQ5MWC5iqNUFN6Y,6332
|
|
9
9
|
scilens/components/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
10
|
scilens/components/analyse_folder.py,sha256=yqc-dscKaHLZJCYeXGak2v0c3F2aeX0E11AFPfya6r0,208
|
|
11
|
-
scilens/components/compare_2_files.py,sha256=
|
|
11
|
+
scilens/components/compare_2_files.py,sha256=IlgfAi9GTAa9TlCXXjCkSZut_yJoCoXh31ctEokAjjE,2330
|
|
12
12
|
scilens/components/compare_errors.py,sha256=vGb4DWP89HMIeBm0dZU2nt-ksppAs_37xtCHaPd0w5Y,1640
|
|
13
13
|
scilens/components/compare_floats.py,sha256=_FyB5UjFsmZ8tlg6w5dneSvkUeij4UjzXuQERDxFpW0,6465
|
|
14
14
|
scilens/components/compare_folders.py,sha256=s7cgo2JhZi8F7tt3lGbPhkaO2726Lz3c4LYGP2HbWtA,2773
|
|
15
|
-
scilens/components/compare_models.py,sha256=
|
|
15
|
+
scilens/components/compare_models.py,sha256=zSoH0E7vuvcu3i4vbNTyJvqgzHZh_hfO3mZ6UvBzfAo,937
|
|
16
16
|
scilens/components/executor.py,sha256=PLeKolzPd4wPX8e6DdfOb0uHGky3DxTcKN9QtB6oe3Q,3712
|
|
17
17
|
scilens/components/file_reader.py,sha256=7SbKCqb4Co_pqAKX3wweYhqAcVkU7BDlT903sLd76Kc,1407
|
|
18
18
|
scilens/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -53,7 +53,7 @@ scilens/readers/cols_dataset.py,sha256=OpCTS9FmJxCHLoCrrD56sHY3f9dxwTsw2Xyxf_vNv
|
|
|
53
53
|
scilens/readers/exceptions.py,sha256=JzmxcjnR5sH-IOWVeCC5A1bSwxv-jCAtIJvDjzx1CTI,32
|
|
54
54
|
scilens/readers/mat_dataset.py,sha256=Z9TYDWaH2aqdniLNDjlpR6VVNHMSARjh52clhdMyOn4,1496
|
|
55
55
|
scilens/readers/reader_csv.py,sha256=5TQ9TAVSNUje7Mbqy9T1SfJ1f4Ic_bFBTD9S5OuMrGU,5539
|
|
56
|
-
scilens/readers/reader_interface.py,sha256=
|
|
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
59
|
scilens/readers/reader_txt_fixed_cols.py,sha256=Ec4J34M770akw8i07BC2zahVuS8pezP31BsHoS4NyNE,4528
|
|
@@ -72,7 +72,7 @@ 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=jYR-aW4qMQoRwGUQwFP-Eulz42lW4OXQj7Bfqh1F3mA,6665
|
|
76
76
|
scilens/report/templates/compare_13_section_numbers copy.html,sha256=0PWK_I2kNX3LjPLkkY4eSYIeB7YFkA28nk-PPLDhnaY,1753
|
|
77
77
|
scilens/report/templates/compare_13_section_numbers.html,sha256=9etEMSqwrDyJIn_nMbKEVaDgnFL_hBxSjPR-hU2wgDI,851
|
|
78
78
|
scilens/report/templates/compare_13_section_numbers_table.html,sha256=pME7vkcPpP2YF0X_jPeD8hEyjA4i-11slfwuQkfUNNI,2927
|
|
@@ -111,7 +111,7 @@ scilens/utils/template.py,sha256=9dlXX3nmfzDRUwzPJOkoxk15UXivZ2SW-McdCwokFa4,443
|
|
|
111
111
|
scilens/utils/time_tracker.py,sha256=DdVBoMpVLXrX0qZZXyLm4g38EwDVLlRcBqcpNex1mYY,545
|
|
112
112
|
scilens/utils/vectors.py,sha256=4N2BZSC5n3HgZqPujDGF5NdjVmSL1rOHb_qw4OoABQY,103
|
|
113
113
|
scilens/utils/web.py,sha256=MAFWpIFOKz7QhqDoFh-Qwstvc76KpcxstSgHFT8FOL4,901
|
|
114
|
-
scilens-0.4.
|
|
115
|
-
scilens-0.4.
|
|
116
|
-
scilens-0.4.
|
|
117
|
-
scilens-0.4.
|
|
114
|
+
scilens-0.4.5.dist-info/METADATA,sha256=bJI2HXys2vhstgH2EhNbj9-sulm76KUXk3qMMNHUARE,1367
|
|
115
|
+
scilens-0.4.5.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
116
|
+
scilens-0.4.5.dist-info/entry_points.txt,sha256=DaKGgxUEUv34GJAoXtta6ecL37ercejep9sCSSRQK2s,48
|
|
117
|
+
scilens-0.4.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|