scilens 0.4.10__py3-none-any.whl → 0.4.13__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.
@@ -6,82 +6,80 @@ import logging
6
6
  from scilens.components.compare_models import SEVERITY_ERROR,SEVERITY_WARNING,CompareGroup,CompareFloatsErr,Compare2ValuesResults
7
7
  from scilens.components.compare_errors import CompareErrors
8
8
  from scilens.config.models import CompareFloatThresholdsConfig
9
- try:from scilens_compare import vectors as CheckVectors
10
- except ModuleNotFoundError:pass
11
- def vector_get_amplitude(vector):min_val=min(vector);max_val=max(vector);return{'min':min_val,'max':max_val,_D:abs(max_val-min_val)}
9
+ from scilens.components.num import vectors as CheckVectors
10
+ def vector_get_amplitude(vector):A=vector;B=min(A);C=max(A);return{'min':B,'max':C,_D:abs(C-B)}
12
11
  class CompareFloats:
13
- def __init__(self,compare_errors,config):self.compare_errors=compare_errors;self.thresholds=config
14
- def compare_2_values(self,test,reference):
15
- thr=self.thresholds;sign=-1 if test-reference<0 else 1
16
- if abs(test)>thr.relative_vs_absolute_min and reference!=0:
17
- err=abs(test-reference)/abs(reference);comp_err=CompareFloatsErr(is_relative=True,value=sign*err,test=test,reference=reference)
18
- if err<thr.relative_error_max:
19
- if err>thr.relative_error_min:return Compare2ValuesResults(SEVERITY_WARNING,f"Rel. err. > {thr.relative_error_min} and < {thr.relative_error_max}",comp_err)
20
- else:return Compare2ValuesResults(SEVERITY_ERROR,f"Rel. err. > {thr.relative_error_max}",comp_err)
12
+ def __init__(A,compare_errors,config):A.compare_errors=compare_errors;A.thresholds=config
13
+ def compare_2_values(G,test,reference):
14
+ D=test;B=reference;A=G.thresholds;F=-1 if D-B<0 else 1
15
+ if abs(D)>A.relative_vs_absolute_min and B!=0:
16
+ C=abs(D-B)/abs(B);E=CompareFloatsErr(is_relative=True,value=F*C,test=D,reference=B)
17
+ if C<A.relative_error_max:
18
+ if C>A.relative_error_min:return Compare2ValuesResults(SEVERITY_WARNING,f"Rel. err. > {A.relative_error_min} and < {A.relative_error_max}",E)
19
+ else:return Compare2ValuesResults(SEVERITY_ERROR,f"Rel. err. > {A.relative_error_max}",E)
21
20
  else:
22
- err=abs(test-reference);comp_err=CompareFloatsErr(is_relative=_B,value=sign*err,test=test,reference=reference)
23
- if err<thr.absolute_error_max:
24
- if err>thr.absolute_error_min:return Compare2ValuesResults(SEVERITY_WARNING,f"Abs. err. > {thr.absolute_error_min} and < {thr.absolute_error_max}",comp_err)
25
- else:return Compare2ValuesResults(SEVERITY_ERROR,f"Abs. err. > {thr.absolute_error_max}",comp_err)
26
- def compare_dicts(self,test_dict,reference_dict,group):
27
- diffs_count=0;err_limit_reached=_B
28
- if set(test_dict.keys())!=set(reference_dict.keys()):raise Exception('Dictionaries have different keys')
29
- for key in test_dict:
30
- test_value=test_dict[key];reference_value=reference_dict[key];res_compare=self.compare_2_values(test_value,reference_value)
31
- if res_compare:err_limit_reached=self.compare_errors.add(group,res_compare,info={'key':key});diffs_count+=1;group.incr(_C)
32
- if err_limit_reached:break
33
- return err_limit_reached,diffs_count
34
- def compare_vectors(self,test_vector,reference_vector,group,info_vector=_A):
35
- B='ignore';A='RIAE_trapezoid'
36
- if len(test_vector)!=len(reference_vector):raise Exception('Vectors have different lengths')
37
- diffs_count=0;err_limit_reached=_B;ponderation_method=self.thresholds.vectors.ponderation_method if self.thresholds.vectors else _A
38
- if ponderation_method=='RIAE':ponderation_method=A
39
- if ponderation_method:logging.debug(f"Using ponderation method: {ponderation_method} with reduction_method {self.thresholds.vectors.reduction_method}")
40
- amplitude_compare=_A
41
- if self.thresholds.vectors and ponderation_method=='amplitude_moderation':amplitude=vector_get_amplitude(test_vector)[_D];amplitude_compare=amplitude*self.thresholds.vectors.amplitude_moderation_multiplier;reduction_method=self.thresholds.vectors.reduction_method
42
- RIAE_force_severity=_A
43
- if self.thresholds.vectors and ponderation_method in[A,'RIAE_midpoint']:
44
- if'CheckVectors'not in globals():raise Exception('scilens_compare not found. Please install scilens-compare package with `pip install scilens-compare`.')
45
- riae_error=CheckVectors.relative_integral_absolute_error_trapezoid(reference_vector,test_vector,range(len(test_vector)))if ponderation_method==A else CheckVectors.relative_integral_absolute_error_midpoint(reference_vector,test_vector,range(len(test_vector)))
46
- if riae_error is _A:logging.warning('RIAE calculation returned None. This may indicate an issue with the vectors.')
21
+ C=abs(D-B);E=CompareFloatsErr(is_relative=_B,value=F*C,test=D,reference=B)
22
+ if C<A.absolute_error_max:
23
+ if C>A.absolute_error_min:return Compare2ValuesResults(SEVERITY_WARNING,f"Abs. err. > {A.absolute_error_min} and < {A.absolute_error_max}",E)
24
+ else:return Compare2ValuesResults(SEVERITY_ERROR,f"Abs. err. > {A.absolute_error_max}",E)
25
+ def compare_dicts(D,test_dict,reference_dict,group):
26
+ F=group;E=reference_dict;A=test_dict;G=0;B=_B
27
+ if set(A.keys())!=set(E.keys()):raise Exception('Dictionaries have different keys')
28
+ for C in A:
29
+ I=A[C];J=E[C];H=D.compare_2_values(I,J)
30
+ if H:B=D.compare_errors.add(F,H,info={'key':C});G+=1;F.incr(_C)
31
+ if B:break
32
+ return B,G
33
+ def compare_vectors(A,test_vector,reference_vector,group,info_vector=_A):
34
+ R='ignore';M=info_vector;L='RIAE_trapezoid';H=group;F=reference_vector;B=test_vector
35
+ if len(B)!=len(F):raise Exception('Vectors have different lengths')
36
+ N=0;G=_B;D=A.thresholds.vectors.ponderation_method if A.thresholds.vectors else _A
37
+ if D=='RIAE':D=L
38
+ if D:logging.debug(f"Using ponderation method: {D} with reduction_method {A.thresholds.vectors.reduction_method}")
39
+ I=_A
40
+ if A.thresholds.vectors and D=='amplitude_moderation':S=vector_get_amplitude(B)[_D];I=S*A.thresholds.vectors.amplitude_moderation_multiplier;O=A.thresholds.vectors.reduction_method
41
+ J=_A
42
+ if A.thresholds.vectors and D in[L,'RIAE_midpoint']:
43
+ K=CheckVectors.relative_integral_absolute_error_trapezoid(F,B,range(len(B)))if D==L else CheckVectors.relative_integral_absolute_error_midpoint(F,B,range(len(B)))
44
+ if K is _A:logging.warning('RIAE calculation returned None. This may indicate an issue with the vectors.')
47
45
  else:
48
- RIAE_force_severity=self.thresholds.vectors.reduction_method
49
- if riae_error>self.thresholds.vectors.riae_threshold:ee=CompareFloatsErr(is_relative=_B,value=riae_error);res_compare=Compare2ValuesResults(SEVERITY_ERROR,f"RIAE ({ponderation_method}) > {self.thresholds.vectors.riae_threshold}",ee);err_limit_reached=self.compare_errors.add(group,res_compare)
50
- nb=len(test_vector)
51
- for idx in range(nb):
52
- diff=test_vector[idx]-reference_vector[idx]
53
- if diff==0:continue
54
- else:diffs_count+=1;group.incr(_C)
55
- if err_limit_reached:continue
56
- if RIAE_force_severity==B:continue
57
- if amplitude_compare is not _A and abs(diff)<amplitude_compare:
58
- if reduction_method==B:continue
59
- elif reduction_method=='soften':
60
- res_compare=self.compare_2_values(test_vector[idx],reference_vector[idx])
61
- if res_compare:res_compare.severity=SEVERITY_WARNING
46
+ J=A.thresholds.vectors.reduction_method
47
+ if K>A.thresholds.vectors.riae_threshold:T=CompareFloatsErr(is_relative=_B,value=K);C=Compare2ValuesResults(SEVERITY_ERROR,f"RIAE ({D}) > {A.thresholds.vectors.riae_threshold}",T);G=A.compare_errors.add(H,C)
48
+ U=len(B)
49
+ for E in range(U):
50
+ P=B[E]-F[E]
51
+ if P==0:continue
52
+ else:N+=1;H.incr(_C)
53
+ if G:continue
54
+ if J==R:continue
55
+ if I is not _A and abs(P)<I:
56
+ if O==R:continue
57
+ elif O=='soften':
58
+ C=A.compare_2_values(B[E],F[E])
59
+ if C:C.severity=SEVERITY_WARNING
62
60
  else:
63
- res_compare=self.compare_2_values(test_vector[idx],reference_vector[idx])
64
- if res_compare and RIAE_force_severity:res_compare.severity=SEVERITY_WARNING
65
- if res_compare:
66
- info={'index':idx}
67
- if info_vector:info['info']=info_vector[idx]
68
- err_limit_reached=self.compare_errors.add(group,res_compare,info=info)
69
- return err_limit_reached,diffs_count
70
- def add_group_and_compare_vectors(self,group_name,parent_group,group_data,test_vector,reference_vector,info_vector=_A):_,group=self.compare_errors.add_group('vectors',group_name,parent=parent_group,data=group_data);return(group,)+self.compare_vectors(test_vector,reference_vector,group,info_vector=info_vector)
71
- def compare_matrices(self,test_mat,ref_mat,group,x_vector=_A,y_vector=_A):
72
- diffs_count=0;err_limit_reached=_B;test_nb_lines=len(test_mat);test_nb_columns=len(test_mat[0])if test_nb_lines>0 else 0;ref_nb_lines=len(ref_mat);ref_nb_columns=len(ref_mat[0])if ref_nb_lines>0 else 0
73
- if test_nb_lines!=ref_nb_lines or test_nb_columns!=ref_nb_columns:raise Exception('Matrices have different dimensions')
74
- for i in range(test_nb_lines):
75
- for j in range(test_nb_columns):
76
- diff=test_mat[i][j]-ref_mat[i][j]
77
- if diff==0:continue
78
- else:diffs_count+=1;group.incr(_C)
79
- if err_limit_reached:continue
80
- res_compare=self.compare_2_values(test_mat[i][j],ref_mat[i][j])
81
- if res_compare:
82
- info={'i':i+1,'j':j+1}
83
- if x_vector:info['x']=x_vector[j]
84
- if y_vector:info['y']=y_vector[i]
85
- err_limit_reached=self.compare_errors.add(group,res_compare,info=info)
86
- return err_limit_reached,diffs_count
87
- def add_group_and_compare_matrices(self,group_name,parent_group,group_data,test_mat,ref_mat,x_vector=_A,y_vector=_A):_,group=self.compare_errors.add_group('matrix',group_name,parent=parent_group,data=group_data);return(group,)+self.compare_matrices(test_mat,ref_mat,group,x_vector=x_vector,y_vector=y_vector)
61
+ C=A.compare_2_values(B[E],F[E])
62
+ if C and J:C.severity=SEVERITY_WARNING
63
+ if C:
64
+ Q={'index':E}
65
+ if M:Q['info']=M[E]
66
+ G=A.compare_errors.add(H,C,info=Q)
67
+ return G,N
68
+ def add_group_and_compare_vectors(A,group_name,parent_group,group_data,test_vector,reference_vector,info_vector=_A):C,B=A.compare_errors.add_group('vectors',group_name,parent=parent_group,data=group_data);return(B,)+A.compare_vectors(test_vector,reference_vector,B,info_vector=info_vector)
69
+ def compare_matrices(H,test_mat,ref_mat,group,x_vector=_A,y_vector=_A):
70
+ K=y_vector;J=x_vector;I=group;D=ref_mat;C=test_mat;L=0;E=_B;F=len(C);M=len(C[0])if F>0 else 0;N=len(D);P=len(D[0])if N>0 else 0
71
+ if F!=N or M!=P:raise Exception('Matrices have different dimensions')
72
+ for A in range(F):
73
+ for B in range(M):
74
+ Q=C[A][B]-D[A][B]
75
+ if Q==0:continue
76
+ else:L+=1;I.incr(_C)
77
+ if E:continue
78
+ O=H.compare_2_values(C[A][B],D[A][B])
79
+ if O:
80
+ G={'i':A+1,'j':B+1}
81
+ if J:G['x']=J[B]
82
+ if K:G['y']=K[A]
83
+ E=H.compare_errors.add(I,O,info=G)
84
+ return E,L
85
+ def add_group_and_compare_matrices(A,group_name,parent_group,group_data,test_mat,ref_mat,x_vector=_A,y_vector=_A):C,B=A.compare_errors.add_group('matrix',group_name,parent=parent_group,data=group_data);return(B,)+A.compare_matrices(test_mat,ref_mat,B,x_vector=x_vector,y_vector=y_vector)
@@ -0,0 +1,3 @@
1
+ import numpy as np
2
+ def relative_integral_absolute_error_trapezoid(ref_array_like,test_array_like,x_array_like):C=x_array_like;B=test_array_like;A=ref_array_like;F=B if isinstance(B,np.ndarray)else np.array(B);G=A if isinstance(A,np.ndarray)else np.array(A);D=C if isinstance(C,np.ndarray)else np.array(C);H=np.abs(G-F);I=np.trapezoid(H,D);E=np.trapezoid(np.abs(A),D);return I/E if E!=0 else None
3
+ def relative_integral_absolute_error_midpoint(ref_array_like,test_array_like,x_array_like):C=x_array_like;B=test_array_like;A=ref_array_like;G=B if isinstance(B,np.ndarray)else np.array(B);D=A if isinstance(A,np.ndarray)else np.array(A);H=C if isinstance(C,np.ndarray)else np.array(C);I=np.abs(D-G);E=np.diff(H);J=np.sum(I[:-1]*E);F=np.sum(np.abs(D[:-1])*E);return J/F if F!=0 else None
@@ -17,4 +17,4 @@ class ReaderColsCurveParserConfig(BaseModel,extra=_B):
17
17
  elif A.name==ReaderCurveParserNameConfig.COLS_COUPLE:A.parameters=ReaderCurveParserColsCoupleConfig(**A.parameters)
18
18
  return A
19
19
  class ReaderColsRowsConfig(BaseModel,extra=_B):ignore_patterns:list[str]|_A=Field(default=_A,description='Liste des patterns de lignes à ignorer. Ex: ["^#", "^//"]. Non applicable si `is_matrix` est vrai.');line_start:int|_A=Field(default=_A,description='Ligne de début pour lire le fichier (les en-têtes sont comptées comme une ligne). Si non défini, commence à la première ligne.');line_end:int|_A=Field(default=_A,description="Ligne de fin pour lire le fichier (les en-têtes sont comptées comme une ligne). Si non défini, lit jusqu'à la dernière ligne.");index_min_value:float|_A=Field(default=_A,description="Valeur minimale de l'index pour les lignes à lire (valeur incluses).");index_max_value:float|_A=Field(default=_A,description="Valeur maximale de l'index pour les lignes à lire (valeur incluses).")
20
- class ReaderColsConfig(BaseModel,extra=_B):ignore_columns:list[str]|list[int]|_A=Field(default=_A,description="Liste des colonnes à ignorer (nom de l'en tête ou numéro de colonne).");index_col:int|str|list[str]|_A=Field(default=_A,description='Colonne(s) à utiliser comme index (date/heure, itération, étape, ...) (Utilisé dans différentes règles). Numéro de colonne ou nom(s) de colonne. (Valide seulement si non matrice)');rows:ReaderColsRowsConfig|_A=Field(default=_A,description='Configuration des lignes à lire.');curve_parser:ReaderColsCurveParserConfig|_A=Field(default=_A,description='Parseur de courbe à utiliser.')
20
+ class ReaderColsConfig(BaseModel,extra=_B):ignore_columns:list[str]|list[int]|_A=Field(default=_A,description="Liste des colonnes à ignorer (nom de l'en tête ou numéro de colonne).");select_columns:list[str]|list[int]|_A=Field(default=_A,description="Liste des colonnes à sélectionner (nom de l'en tête ou numéro de colonne).");index_col:int|str|list[str]|_A=Field(default=_A,description='Colonne(s) à utiliser comme index (date/heure, itération, étape, ...) (Utilisé dans différentes règles). Numéro de colonne ou nom(s) de colonne. (Valide seulement si non matrice)');rows:ReaderColsRowsConfig|_A=Field(default=_A,description='Configuration des lignes à lire.');curve_parser:ReaderColsCurveParserConfig|_A=Field(default=_A,description='Parseur de courbe à utiliser.')
@@ -2,7 +2,7 @@ _A=None
2
2
  import os
3
3
  from pydantic import BaseModel
4
4
  from scilens.utils.file import list_paths_for_file_recursive,text_write
5
- from scilens.report.template import template_render_infolder
5
+ from scilens.utils.template import template_render_infolder
6
6
  from scilens.report.assets import get_logo_image_src
7
7
  class PathSearchInfo(BaseModel):path:str;dir:str;relative_path:str;relative_dir:str
8
8
  CURRENT_DIR=os.path.dirname(os.path.realpath(__file__))
@@ -38,7 +38,7 @@ class ReaderCsv(ReaderInterface):
38
38
  if A.index_col_index is _A:raise ValueError('Index column must be defined to use index min/max values.')
39
39
  I=B.rows.index_min_value;J=B.rows.index_max_value
40
40
  if I and J and I>J:raise ValueError(f"Index min value {I} cannot be greater than index max value {J}.")
41
- A.raw_lines_number=_A;A.curves=_A;A.report_matrices=_A
41
+ A.raw_lines_number=_A;A.curves=_A;A.report_matrices=_A;A.metrics=_A
42
42
  with open(A.origin.path,'r',encoding=A.encoding)as W:
43
43
  S=W.readlines();M=csv.reader(S,delimiter=A.reader_options.delimiter,quotechar=A.reader_options.quotechar)
44
44
  if C.is_matrix:
@@ -70,7 +70,7 @@ class ReaderCsv(ReaderInterface):
70
70
  D.data[U].append(Q)
71
71
  D.origin_line_nb.append(E)
72
72
  except StopIteration:pass
73
- D.rows_count=len(D.origin_line_nb);A.cols_dataset=D;A.raw_lines_number=D.rows_count+(1 if F else 0);A.metrics=_A
73
+ D.rows_count=len(D.origin_line_nb);A.cols_dataset=D;A.raw_lines_number=D.rows_count+(1 if F else 0)
74
74
  if C.metrics:A.metrics=D.compute_metrics(C.metrics)
75
75
  if B and B.curve_parser:
76
76
  if B.curve_parser.name==ReaderCurveParserNameConfig.COL_X:
@@ -69,21 +69,24 @@ class ReaderTxtFixedCols(ReaderInterface):
69
69
  if D and D.ignore_columns:
70
70
  if isinstance(D.ignore_columns[0],str):C.numeric_col_indexes=[A for A in C.numeric_col_indexes if C.names[A]not in D.ignore_columns]
71
71
  if isinstance(D.ignore_columns[0],int):Q=[A-1 for A in D.ignore_columns];C.numeric_col_indexes=[A for A in C.numeric_col_indexes if A not in Q]
72
+ if D and D.select_columns:
73
+ if isinstance(D.select_columns[0],str):C.numeric_col_indexes=[A for A in C.numeric_col_indexes if C.names[A]in D.select_columns]
74
+ if isinstance(D.select_columns[0],int):R=[A-1 for A in D.select_columns];C.numeric_col_indexes=[A for A in C.numeric_col_indexes if A in R]
72
75
  H=I or 0
73
76
  for N in islice(L,I,K):
74
77
  H+=1
75
78
  if A._ignore_line(N):continue
76
79
  if F:
77
80
  if F.ori_line_idx==H-1:continue
78
- for(R,O)in enumerate(E):S=N[O[0]:O[1]].strip();T=string_2_float(S);C.data[R].append(T)
81
+ for(S,O)in enumerate(E):T=N[O[0]:O[1]].strip();U=string_2_float(T);C.data[S].append(U)
79
82
  C.origin_line_nb.append(H)
80
83
  C.rows_count=len(C.origin_line_nb);L.close();A.cols_dataset=C;A.raw_lines_number=H;A.metrics=_A
81
84
  if B.metrics:A.metrics=C.compute_metrics(B.metrics)
82
85
  A.curves=_A;A.cols_curve=_A
83
86
  if B.cols and B.cols.curve_parser:
84
87
  if B.cols.curve_parser.name==ReaderCurveParserNameConfig.COL_X:
85
- A.curves,U=C.get_curves_col_x(B.cols.curve_parser.parameters.x)
86
- if A.curves:A.cols_curve=ColsCurves(type=ReaderCurveParserNameConfig.COL_X,info=U,curves=A.curves)
88
+ A.curves,V=C.get_curves_col_x(B.cols.curve_parser.parameters.x)
89
+ if A.curves:A.cols_curve=ColsCurves(type=ReaderCurveParserNameConfig.COL_X,info=V,curves=A.curves)
87
90
  elif B.cols.curve_parser.name==ReaderCurveParserNameConfig.COLS_COUPLE:raise NotImplementedError('cols_couple not implemented')
88
91
  else:raise Exception('Curve parser not supported.')
89
92
  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)
@@ -1,6 +1,6 @@
1
1
  import logging,os
2
2
  from scilens.config.models import ReportConfig
3
- from scilens.report.template import template_render_infolder
3
+ from scilens.utils.template import template_render_infolder
4
4
  from scilens.report.assets import get_image_base64,get_image_base64_local,get_logo_image_src
5
5
  class HtmlReport:
6
6
  def __init__(A,config,alt_config_dirs,working_dir=None):A.config=config;A.alt_config_dirs=alt_config_dirs;A.working_dir=working_dir
@@ -21,4 +21,4 @@ class HtmlReport:
21
21
  if not B:raise FileNotFoundError(f"Logo file '{A.config.logo_file}' not found in {E}.")
22
22
  F=None
23
23
  if A.config.debug:F=A.config.model_dump_json(indent=4)
24
- return template_render_infolder('index.html',{'image':H or get_logo_image_src(B),'execution_dir':A.working_dir,'config_html':A.config.html,'config_html_json':A.config.html.model_dump_json(),G:data.get(G),'data':{'files':data.get('processor_results')},'debug':F})
24
+ return template_render_infolder('index.html',{'image':H or get_logo_image_src(B),'execution_dir':A.working_dir,'config_html':A.config.html,'config_html_json':A.config.html.model_dump_json(),G:data.get(G),'data':{'files':data.get('processor_results')},'debug':F},template_dir=os.path.join(os.path.dirname(os.path.realpath(__file__)),'templates'))
scilens/utils/template.py CHANGED
@@ -1,5 +1,4 @@
1
1
  from jinja2 import Template,Environment,FileSystemLoader
2
+ def none_to_empty(value):A=value;return''if A is None else A
2
3
  def template_render_string(template_str,context):return Template(template_str).render(context)
3
- def template_render_path(filepath,context):
4
- with open(filepath,'r')as A:B=A.read();return template_render_string(B,context)
5
- def template_render_infolder(filename,context,template_dir):A=FileSystemLoader([template_dir]);B=Environment(loader=A);return B.get_template(filename).render(context)
4
+ def template_render_infolder(filename,context,template_dir):A=FileSystemLoader([template_dir]);B=Environment(loader=A,finalize=none_to_empty);return B.get_template(filename).render(context)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: scilens
3
- Version: 0.4.10
3
+ Version: 0.4.13
4
4
  Summary: A CesGensLaB framework for data collecting and deep analysis
5
5
  Home-page: https://scilens.dev
6
6
  License: Proprietary
@@ -14,11 +14,12 @@ Classifier: Programming Language :: Python :: 3.11
14
14
  Classifier: Programming Language :: Python :: 3.12
15
15
  Classifier: Programming Language :: Python :: 3.13
16
16
  Requires-Dist: coloredlogs (>=15.0.1,<16.0.0)
17
- Requires-Dist: jinja2 (>=3.1.4,<4.0.0)
18
- Requires-Dist: pydantic (>=2.10.2,<3.0.0)
17
+ Requires-Dist: jinja2 (>=3.1.6,<4.0.0)
18
+ Requires-Dist: numpy (>=2.2.6,<3.0.0)
19
+ Requires-Dist: pydantic (>=2.11.7,<3.0.0)
19
20
  Requires-Dist: pyyaml (>=6.0.2,<7.0.0)
20
- Requires-Dist: requests (>=2.32.3,<3.0.0)
21
- Requires-Dist: rich-click (>=1.8.4,<2.0.0)
21
+ Requires-Dist: requests (>=2.32.5,<3.0.0)
22
+ Requires-Dist: rich-click (>=1.8.9,<2.0.0)
22
23
  Project-URL: Documentation, https://scilens.dev/docs
23
24
  Description-Content-Type: text/markdown
24
25
 
@@ -10,11 +10,12 @@ scilens/components/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
10
10
  scilens/components/analyse_folder.py,sha256=yqc-dscKaHLZJCYeXGak2v0c3F2aeX0E11AFPfya6r0,208
11
11
  scilens/components/compare_2_files.py,sha256=IlgfAi9GTAa9TlCXXjCkSZut_yJoCoXh31ctEokAjjE,2330
12
12
  scilens/components/compare_errors.py,sha256=vGb4DWP89HMIeBm0dZU2nt-ksppAs_37xtCHaPd0w5Y,1640
13
- scilens/components/compare_floats.py,sha256=_FyB5UjFsmZ8tlg6w5dneSvkUeij4UjzXuQERDxFpW0,6465
13
+ scilens/components/compare_floats.py,sha256=LPbA-l5NBoZ5WbLLU3b2R5XsHlQY9iwcc0BHjqcUhpw,4646
14
14
  scilens/components/compare_folders.py,sha256=s7cgo2JhZi8F7tt3lGbPhkaO2726Lz3c4LYGP2HbWtA,2773
15
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
+ scilens/components/num/vectors.py,sha256=r2FBOzGfAFkLiLRShIp72V3chDvIR0ZJ3f4_p4m7gzY,782
18
19
  scilens/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
20
  scilens/config/cli_run_options.py,sha256=Ls7yK5QDUPFbk73nbjGuPvuRbBRYw4Miag5ISpu3prg,281
20
21
  scilens/config/env_var.py,sha256=NqNBoIfngJEXaGEm7jGqre5pmkJ9eUjiWzbDrTVfi2c,292
@@ -27,7 +28,7 @@ scilens/config/models/compare_float_thresholds.py,sha256=M8flQmu5B-Lc-RStn-kcQJZ
27
28
  scilens/config/models/execute.py,sha256=yF_q8swd4-s2KyT_RwtSzOW41AY5GiEZaLhGUGJBU0Y,2340
28
29
  scilens/config/models/execute_and_compare.py,sha256=aIWF1NIgdq5USS9ZVWOKgpEyMagCvqYYWYSXWvBBgjg,597
29
30
  scilens/config/models/file_reader.py,sha256=0-ldLt4YVmb2IwdfEHiIqDsioyXwqSkxrlfuEOmcyrA,1191
30
- scilens/config/models/reader_format_cols.py,sha256=-nvPjZImao_RFVAlyvTZG1fCXa3hhkH9th4lOD3ZLT4,3382
31
+ scilens/config/models/reader_format_cols.py,sha256=j1WbmmhigtVU5kE0yfojTji3zmTZZlZHJ1-cc-nTewM,3531
31
32
  scilens/config/models/reader_format_csv.py,sha256=KWEH0c12n6hdaWAKdHXYMT5SvH4UqBFvP7d3ZkJr7r8,1620
32
33
  scilens/config/models/reader_format_netcdf.py,sha256=Skr5lZACqVRrrlvs7R1RVFBpMTDthLJN-Fbs24jtb7o,1271
33
34
  scilens/config/models/reader_format_txt.py,sha256=35rvhg311DN9miE47QM9NN_gcZHglYG2lBZPLJy4iyg,1462
@@ -38,7 +39,7 @@ scilens/config/models/report.py,sha256=_4W96v5izWCC_CrMzh3PM0mZIUAa3L26ZQqjV0Mv0
38
39
  scilens/config/models/report_html.py,sha256=IsKlmE7QbSTiPrOaxPc48Ne7xPE5yqTcLjxqN_i-unY,3803
39
40
  scilens/config/models/report_output.py,sha256=XfzTsd1G3QjbZFer9dkWa1pa3HKbmK85UcHg6A7loOQ,890
40
41
  scilens/helpers/assets.py,sha256=XphDA3-yE1PPKw4XFZhDrlLQjMZfGMlpOBXa8uy_xX0,1552
41
- scilens/helpers/search_and_index.py,sha256=kXZ7124ra_SGAdKUZ7msy55UOWQ9dCSuPuNoU-NdUyM,1522
42
+ scilens/helpers/search_and_index.py,sha256=ceqKP0xM7EA4U0OMnsRK7xTG5txJbg_iYNP_cWV_TiU,1521
42
43
  scilens/helpers/templates/index.html,sha256=hwoABZ7mWbN92VZhAMrloTdm_-leW8aQRbRfyafXl3Q,490
43
44
  scilens/helpers/templates/style.css,sha256=2_IndKW2qtGhuoU9T3Sru4NkHR5CXTTs5_nc9byktVI,3185
44
45
  scilens/processors/__init__.py,sha256=x6bmqQVCcdJ7R2oG-_xTVtvl9qRleliEZlZR-Hq9Yc0,105
@@ -52,22 +53,21 @@ scilens/readers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
53
  scilens/readers/cols_dataset.py,sha256=r8-torONsaXzYUvKRjguCu_d36MSv1ceWxNoRP2-9xk,4018
53
54
  scilens/readers/exceptions.py,sha256=JzmxcjnR5sH-IOWVeCC5A1bSwxv-jCAtIJvDjzx1CTI,32
54
55
  scilens/readers/mat_dataset.py,sha256=Z9TYDWaH2aqdniLNDjlpR6VVNHMSARjh52clhdMyOn4,1496
55
- scilens/readers/reader_csv.py,sha256=FKxx26Vzf_h25cFX37DwFXy_-toUGw3481iMbyRa-vg,5550
56
+ scilens/readers/reader_csv.py,sha256=yq2MRHYk3C5NIkFbkl6gM-CFUUPTwgm8W-2-g_WaQ5M,5550
56
57
  scilens/readers/reader_interface.py,sha256=r1pu9LyweTGXU8YfI3FPZy1Em4stzmJb-6j90j1tPQQ,938
57
58
  scilens/readers/reader_manager.py,sha256=DFinxIk3IIIcB6JxybGcv-mXt3jhXgCwUtzR0TqhB2Q,2684
58
59
  scilens/readers/reader_txt.py,sha256=U3hGIorj-Nv-jq6zYtvbDv2LQBHTgW52PHbV8A5FMA8,4526
59
- scilens/readers/reader_txt_fixed_cols.py,sha256=uVzcblWlfsdBZzboPXtsWC9H3jSNjfMp87pUkqnW3sE,4617
60
+ scilens/readers/reader_txt_fixed_cols.py,sha256=t7vdRwt7g6-PqGer-kBdtYu7Ou75m_nKpQarBJmKxnk,4921
60
61
  scilens/readers/transform.py,sha256=kppfgPkXymF0qtquFivuosLVfF66L9bE-wGx-3bMHv8,307
61
62
  scilens/report/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
62
63
  scilens/report/assets/logo.svg,sha256=W-1OVqcvdBjf-1AHHcV6WciIUqBoVFUh52Tc3o_jqtA,4519
63
64
  scilens/report/assets/logo_cglb.svg,sha256=tEpkSr2h-jjQMecqiHef98Mxod4GD5j5nCQaFloTYso,2411
64
65
  scilens/report/assets.py,sha256=CcfGc9NNGnPVinkHZkEyN2S_BGKNIyMFvVdA__-M6-0,532
65
- scilens/report/html_report.py,sha256=lfRUUyNqb2HjdohKXpt1XZW2s6mhwL7mwzbLpVoahzk,1305
66
+ scilens/report/html_report.py,sha256=75bSG6KAm6G3rFiTiZjH_mBtXQeS8tqp3b5kMllkqVw,1387
66
67
  scilens/report/report.py,sha256=tgtpP4gCN0gKUx-6Owtmb18sOFjFCKuk9pWM30jaWS8,1806
67
68
  scilens/report/report_app_info.py,sha256=r3umU64EDKilxxQha0SC2dupt33fBen-dKA44McseTU,348
68
69
  scilens/report/report_attributes_info.py,sha256=OjPjXpTvQJvu1-iHBhnGcPuaniG56fcZ7wpH4ZZ3L5w,367
69
70
  scilens/report/report_processor_info.py,sha256=2A1bGqLYPPIzCHkNlfw--FGoS_HeYRh-oonBlSRmrgs,310
70
- scilens/report/template.py,sha256=cPs5gd3uEwb-6JgitGQD_i4IiUxigBTlZLNRS9KVuos,581
71
71
  scilens/report/templates/body_01_title.html,sha256=jjWspY_B2w_QA49Ag9U6-Yrzz4ohl728nytDxyHXlnw,2359
72
72
  scilens/report/templates/body_02_tabs.html,sha256=hooRO_OJPwAQSa6GBsPLca-OnpiHkr3wZ_0NoXGKGR0,465
73
73
  scilens/report/templates/body_99_footer.html,sha256=KGTKa_DF0dMsX9K4vEbPxy0gY0Kcj0HSEHh0M3sx5TA,392
@@ -112,11 +112,11 @@ scilens/utils/file.py,sha256=nzO7Hb4Xuhi75u43F-LbHESw3YsAnV59nJ23Fq3-7e4,1920
112
112
  scilens/utils/load_model_from_file.py,sha256=k5I-B6s5nVZu90MgzKSM0_IRj9oNL-4oJJRTwEvOyw8,619
113
113
  scilens/utils/php.py,sha256=VBJxpzwwRPNcr3379f6ViwhpTzjGc4BKlSXHv4lnor8,444
114
114
  scilens/utils/system.py,sha256=drXp_Vdv2dP9wFQoEQZIhxyCJhFliBLFPylGwv89FF4,182
115
- scilens/utils/template.py,sha256=9dlXX3nmfzDRUwzPJOkoxk15UXivZ2SW-McdCwokFa4,443
115
+ scilens/utils/template.py,sha256=KXBfzeCRQyBT0KNzWvGEVNVqTlRStyx4V3c_N4H29sc,402
116
116
  scilens/utils/time_tracker.py,sha256=DdVBoMpVLXrX0qZZXyLm4g38EwDVLlRcBqcpNex1mYY,545
117
117
  scilens/utils/vectors.py,sha256=4N2BZSC5n3HgZqPujDGF5NdjVmSL1rOHb_qw4OoABQY,103
118
118
  scilens/utils/web.py,sha256=MAFWpIFOKz7QhqDoFh-Qwstvc76KpcxstSgHFT8FOL4,901
119
- scilens-0.4.10.dist-info/METADATA,sha256=Vyqc2PLaiVNXgdUTsYsj8Q-d1oP-b6Hy4TiPAvmw2_o,1368
120
- scilens-0.4.10.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
121
- scilens-0.4.10.dist-info/entry_points.txt,sha256=DaKGgxUEUv34GJAoXtta6ecL37ercejep9sCSSRQK2s,48
122
- scilens-0.4.10.dist-info/RECORD,,
119
+ scilens-0.4.13.dist-info/METADATA,sha256=eX8VzQR_dBFyAUOm3viEMp74sGMdexYhsl04XMlM3Vw,1406
120
+ scilens-0.4.13.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
121
+ scilens-0.4.13.dist-info/entry_points.txt,sha256=DaKGgxUEUv34GJAoXtta6ecL37ercejep9sCSSRQK2s,48
122
+ scilens-0.4.13.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- import os
2
- from jinja2 import Template,Environment,FileSystemLoader
3
- CURRENT_DIR=os.path.dirname(os.path.realpath(__file__))
4
- TEMPLATE_DIR=os.path.join(CURRENT_DIR,'templates')
5
- def template_render_path(filepath,data):
6
- with open(filepath,'r')as A:B=A.read();C=Template(B);return C.render(data)
7
- def template_render(filename,data):return template_render_path(os.path.join(TEMPLATE_DIR,filename),data)
8
- def template_render_infolder(filename,data,template_dir=None):A=FileSystemLoader([template_dir or TEMPLATE_DIR]);B=Environment(loader=A);C=B.get_template(filename);return C.render(data)