scilens 0.4.8__py3-none-any.whl → 0.4.9__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.
@@ -49,6 +49,7 @@ class ColsDataset:
49
49
  if J=='euclidean_norm':
50
50
  if not I:I=f"Euclidean Norm {F.components} {D}"
51
51
  M=K.get_col_indexes(F.components)
52
+ if not M:continue
52
53
  for N in M:
53
54
  for(O,P)in enumerate(C.data[N]):A[O]+=P**2
54
55
  A=[math.sqrt(A)for A in A]
@@ -27,10 +27,10 @@ class ReaderCsv(ReaderInterface):
27
27
  if bool(re.match(B,line)):return _B
28
28
  return False
29
29
  def read(A,reader_options):
30
- C=reader_options;A.reader_options=C;F,O,V=csv_detect(A.origin.path,A.reader_options.delimiter,A.reader_options.quotechar,encoding=A.encoding);A.has_header=F;A.cols=O;A.numeric_col_indexes=V;A.index_col_index=_A;A.ignore_lines_patterns=_A;G=_A;H=_A;I=_A;J=_A;B=C.cols
30
+ C=reader_options;A.reader_options=C;F,L,V=csv_detect(A.origin.path,A.reader_options.delimiter,A.reader_options.quotechar,encoding=A.encoding);A.has_header=F;A.cols=L;A.numeric_col_indexes=V;A.index_col_index=_A;A.ignore_lines_patterns=_A;G=_A;H=_A;I=_A;J=_A;B=C.cols
31
31
  if B:
32
32
  if B.index_col:
33
- if B.index_col:R=get_col_indexes(col_x,D.numeric_col_indexes,D.names);A.index_col_index=R[0]if R else _A
33
+ if B.index_col:R=get_col_indexes(B.index_col,A.numeric_col_indexes,L);A.index_col_index=R[0]if R else _A
34
34
  if B.rows:
35
35
  A.ignore_lines_patterns=B.rows.ignore_patterns;G=B.rows.line_start;H=B.rows.line_end
36
36
  if G and H and H<G:raise ValueError(f"Line end {H} cannot be before line start {G}.")
@@ -40,9 +40,9 @@ class ReaderCsv(ReaderInterface):
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
41
  A.raw_lines_number=_A;A.curves=_A;A.report_matrices=_A
42
42
  with open(A.origin.path,'r',encoding=A.encoding)as W:
43
- S=W.readlines();L=csv.reader(S,delimiter=A.reader_options.delimiter,quotechar=A.reader_options.quotechar)
43
+ S=W.readlines();M=csv.reader(S,delimiter=A.reader_options.delimiter,quotechar=A.reader_options.quotechar)
44
44
  if C.is_matrix:
45
- K=C.matrix or ReaderCsvMatrixConfig();P=mat_from_iterator(x_name=K.x_name,y_name=K.y_name,reader=L,has_header=F,x_value_line=K.x_value_line,has_y=K.has_y)
45
+ K=C.matrix or ReaderCsvMatrixConfig();P=mat_from_iterator(x_name=K.x_name,y_name=K.y_name,reader=M,has_header=F,x_value_line=K.x_value_line,has_y=K.has_y)
46
46
  if K.export_report:A.report_matrices=get_data([P],['csv'])
47
47
  A.mat_dataset=P;A.raw_lines_number=P.nb_lines+(1 if F else 0)
48
48
  else:
@@ -50,22 +50,22 @@ class ReaderCsv(ReaderInterface):
50
50
  if not F:raise Exception('Ignore columns is not supported without header.')
51
51
  if isinstance(C.cols.ignore_columns[0],str):A.numeric_col_indexes=[B for B in A.numeric_col_indexes if A.cols[B]not in C.cols.ignore_columns]
52
52
  if isinstance(C.cols.ignore_columns[0],int):X=[A-1 for A in B.ignore_columns];A.numeric_col_indexes=[A for A in A.numeric_col_indexes if A not in X]
53
- T=len(O);D=ColsDataset(cols_count=T,names=O,numeric_col_indexes=A.numeric_col_indexes,data=[[]for A in range(T)]);E=0
54
- if F and E==0:next(L);E+=1
53
+ T=len(L);D=ColsDataset(cols_count=T,names=L,numeric_col_indexes=A.numeric_col_indexes,data=[[]for A in range(T)]);E=0
54
+ if F and E==0:next(M);E+=1
55
55
  if G:
56
56
  try:
57
57
  while _B:
58
58
  if G<=E+1:break
59
- M=next(L);E+=1
59
+ N=next(M);E+=1
60
60
  except StopIteration:pass
61
61
  try:
62
62
  while _B:
63
- M=next(L);E+=1
63
+ N=next(M);E+=1
64
64
  if H and E>H:break
65
- if J is not _A and float(M[A.index_col_index])>J:break
65
+ if J is not _A and float(N[A.index_col_index])>J:break
66
66
  if A.ignore_lines_patterns and A._ignore_line(S[E-1].rstrip('\n')):continue
67
- if I is not _A and float(M[A.index_col_index])<I:continue
68
- for(U,Q)in enumerate(M):
67
+ if I is not _A and float(N[A.index_col_index])<I:continue
68
+ for(U,Q)in enumerate(N):
69
69
  if U in D.numeric_col_indexes:Q=float(Q)
70
70
  D.data[U].append(Q)
71
71
  D.origin_line_nb.append(E)
@@ -74,11 +74,11 @@ class ReaderCsv(ReaderInterface):
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:
77
- N=_A
78
- if B.curve_parser.parameters:N=B.curve_parser.parameters.x
79
- elif B.index_col:N=B.index_col
80
- if not N:raise ValueError('Curve parser COL_X requires a parameter x, or index_col to be defined.')
81
- A.curves,Y=D.get_curves_col_x(N)
77
+ O=_A
78
+ if B.curve_parser.parameters:O=B.curve_parser.parameters.x
79
+ elif B.index_col:O=B.index_col
80
+ if not O:raise ValueError('Curve parser COL_X requires a parameter x, or index_col to be defined.')
81
+ A.curves,Y=D.get_curves_col_x(O)
82
82
  if A.curves:A.cols_curve=ColsCurves(type=ReaderCurveParserNameConfig.COL_X,info=Y,curves=A.curves)
83
83
  elif B.curve_parser.name==ReaderCurveParserNameConfig.COLS_COUPLE:raise NotImplementedError('cols_couple not implemented')
84
84
  else:raise Exception('Curve parser not supported.')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: scilens
3
- Version: 0.4.8
3
+ Version: 0.4.9
4
4
  Summary: A CesGensLaB framework for data collecting and deep analysis
5
5
  Home-page: https://scilens.dev
6
6
  License: Proprietary
@@ -49,10 +49,10 @@ scilens/processors/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
49
49
  scilens/processors/models/results.py,sha256=KoWxh13Zgi7PuPql8hkf4VjCis42ZxAuzIgJxBWVaX8,119
50
50
  scilens/processors/processor_interface.py,sha256=jzMp1529JXnMGTJijVy6b_1zmARAMNv70f2lgys7vn4,452
51
51
  scilens/readers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
- scilens/readers/cols_dataset.py,sha256=l6WXl71n-yTgUUbd2KEMwwXmXdqF54N9edeI3saAO84,3941
52
+ scilens/readers/cols_dataset.py,sha256=6Cq9aIG4UMOdam_zx64lf2f0e2f0lI2VZDNZklccBaI,3964
53
53
  scilens/readers/exceptions.py,sha256=JzmxcjnR5sH-IOWVeCC5A1bSwxv-jCAtIJvDjzx1CTI,32
54
54
  scilens/readers/mat_dataset.py,sha256=Z9TYDWaH2aqdniLNDjlpR6VVNHMSARjh52clhdMyOn4,1496
55
- scilens/readers/reader_csv.py,sha256=TygAwFFqj8K7d-M2HtD3VzhS8nobPATQ0QmLJOOAye0,5550
55
+ scilens/readers/reader_csv.py,sha256=FKxx26Vzf_h25cFX37DwFXy_-toUGw3481iMbyRa-vg,5550
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
@@ -113,7 +113,7 @@ scilens/utils/template.py,sha256=9dlXX3nmfzDRUwzPJOkoxk15UXivZ2SW-McdCwokFa4,443
113
113
  scilens/utils/time_tracker.py,sha256=DdVBoMpVLXrX0qZZXyLm4g38EwDVLlRcBqcpNex1mYY,545
114
114
  scilens/utils/vectors.py,sha256=4N2BZSC5n3HgZqPujDGF5NdjVmSL1rOHb_qw4OoABQY,103
115
115
  scilens/utils/web.py,sha256=MAFWpIFOKz7QhqDoFh-Qwstvc76KpcxstSgHFT8FOL4,901
116
- scilens-0.4.8.dist-info/METADATA,sha256=Iq6R89SiRZfEtfeFJllKZWJYnMXrsDTO6Fgbs7ztNaY,1367
117
- scilens-0.4.8.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
118
- scilens-0.4.8.dist-info/entry_points.txt,sha256=DaKGgxUEUv34GJAoXtta6ecL37ercejep9sCSSRQK2s,48
119
- scilens-0.4.8.dist-info/RECORD,,
116
+ scilens-0.4.9.dist-info/METADATA,sha256=pz6dHk21Xl_u0bwZeCj6clWQivZddEpxCJ2KsLVW2Xk,1367
117
+ scilens-0.4.9.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
118
+ scilens-0.4.9.dist-info/entry_points.txt,sha256=DaKGgxUEUv34GJAoXtta6ecL37ercejep9sCSSRQK2s,48
119
+ scilens-0.4.9.dist-info/RECORD,,