scilens 0.4.10__py3-none-any.whl → 0.4.11__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/helpers/search_and_index.py +1 -1
- scilens/readers/reader_csv.py +2 -2
- scilens/report/html_report.py +2 -2
- scilens/utils/template.py +2 -3
- {scilens-0.4.10.dist-info → scilens-0.4.11.dist-info}/METADATA +1 -1
- {scilens-0.4.10.dist-info → scilens-0.4.11.dist-info}/RECORD +8 -9
- scilens/report/template.py +0 -8
- {scilens-0.4.10.dist-info → scilens-0.4.11.dist-info}/WHEEL +0 -0
- {scilens-0.4.10.dist-info → scilens-0.4.11.dist-info}/entry_points.txt +0 -0
|
@@ -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.
|
|
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__))
|
scilens/readers/reader_csv.py
CHANGED
|
@@ -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)
|
|
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:
|
scilens/report/html_report.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import logging,os
|
|
2
2
|
from scilens.config.models import ReportConfig
|
|
3
|
-
from scilens.
|
|
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
|
|
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)
|
|
@@ -38,7 +38,7 @@ scilens/config/models/report.py,sha256=_4W96v5izWCC_CrMzh3PM0mZIUAa3L26ZQqjV0Mv0
|
|
|
38
38
|
scilens/config/models/report_html.py,sha256=IsKlmE7QbSTiPrOaxPc48Ne7xPE5yqTcLjxqN_i-unY,3803
|
|
39
39
|
scilens/config/models/report_output.py,sha256=XfzTsd1G3QjbZFer9dkWa1pa3HKbmK85UcHg6A7loOQ,890
|
|
40
40
|
scilens/helpers/assets.py,sha256=XphDA3-yE1PPKw4XFZhDrlLQjMZfGMlpOBXa8uy_xX0,1552
|
|
41
|
-
scilens/helpers/search_and_index.py,sha256=
|
|
41
|
+
scilens/helpers/search_and_index.py,sha256=ceqKP0xM7EA4U0OMnsRK7xTG5txJbg_iYNP_cWV_TiU,1521
|
|
42
42
|
scilens/helpers/templates/index.html,sha256=hwoABZ7mWbN92VZhAMrloTdm_-leW8aQRbRfyafXl3Q,490
|
|
43
43
|
scilens/helpers/templates/style.css,sha256=2_IndKW2qtGhuoU9T3Sru4NkHR5CXTTs5_nc9byktVI,3185
|
|
44
44
|
scilens/processors/__init__.py,sha256=x6bmqQVCcdJ7R2oG-_xTVtvl9qRleliEZlZR-Hq9Yc0,105
|
|
@@ -52,7 +52,7 @@ scilens/readers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
52
52
|
scilens/readers/cols_dataset.py,sha256=r8-torONsaXzYUvKRjguCu_d36MSv1ceWxNoRP2-9xk,4018
|
|
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=
|
|
55
|
+
scilens/readers/reader_csv.py,sha256=yq2MRHYk3C5NIkFbkl6gM-CFUUPTwgm8W-2-g_WaQ5M,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
|
|
@@ -62,12 +62,11 @@ scilens/report/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
62
62
|
scilens/report/assets/logo.svg,sha256=W-1OVqcvdBjf-1AHHcV6WciIUqBoVFUh52Tc3o_jqtA,4519
|
|
63
63
|
scilens/report/assets/logo_cglb.svg,sha256=tEpkSr2h-jjQMecqiHef98Mxod4GD5j5nCQaFloTYso,2411
|
|
64
64
|
scilens/report/assets.py,sha256=CcfGc9NNGnPVinkHZkEyN2S_BGKNIyMFvVdA__-M6-0,532
|
|
65
|
-
scilens/report/html_report.py,sha256=
|
|
65
|
+
scilens/report/html_report.py,sha256=75bSG6KAm6G3rFiTiZjH_mBtXQeS8tqp3b5kMllkqVw,1387
|
|
66
66
|
scilens/report/report.py,sha256=tgtpP4gCN0gKUx-6Owtmb18sOFjFCKuk9pWM30jaWS8,1806
|
|
67
67
|
scilens/report/report_app_info.py,sha256=r3umU64EDKilxxQha0SC2dupt33fBen-dKA44McseTU,348
|
|
68
68
|
scilens/report/report_attributes_info.py,sha256=OjPjXpTvQJvu1-iHBhnGcPuaniG56fcZ7wpH4ZZ3L5w,367
|
|
69
69
|
scilens/report/report_processor_info.py,sha256=2A1bGqLYPPIzCHkNlfw--FGoS_HeYRh-oonBlSRmrgs,310
|
|
70
|
-
scilens/report/template.py,sha256=cPs5gd3uEwb-6JgitGQD_i4IiUxigBTlZLNRS9KVuos,581
|
|
71
70
|
scilens/report/templates/body_01_title.html,sha256=jjWspY_B2w_QA49Ag9U6-Yrzz4ohl728nytDxyHXlnw,2359
|
|
72
71
|
scilens/report/templates/body_02_tabs.html,sha256=hooRO_OJPwAQSa6GBsPLca-OnpiHkr3wZ_0NoXGKGR0,465
|
|
73
72
|
scilens/report/templates/body_99_footer.html,sha256=KGTKa_DF0dMsX9K4vEbPxy0gY0Kcj0HSEHh0M3sx5TA,392
|
|
@@ -112,11 +111,11 @@ scilens/utils/file.py,sha256=nzO7Hb4Xuhi75u43F-LbHESw3YsAnV59nJ23Fq3-7e4,1920
|
|
|
112
111
|
scilens/utils/load_model_from_file.py,sha256=k5I-B6s5nVZu90MgzKSM0_IRj9oNL-4oJJRTwEvOyw8,619
|
|
113
112
|
scilens/utils/php.py,sha256=VBJxpzwwRPNcr3379f6ViwhpTzjGc4BKlSXHv4lnor8,444
|
|
114
113
|
scilens/utils/system.py,sha256=drXp_Vdv2dP9wFQoEQZIhxyCJhFliBLFPylGwv89FF4,182
|
|
115
|
-
scilens/utils/template.py,sha256=
|
|
114
|
+
scilens/utils/template.py,sha256=KXBfzeCRQyBT0KNzWvGEVNVqTlRStyx4V3c_N4H29sc,402
|
|
116
115
|
scilens/utils/time_tracker.py,sha256=DdVBoMpVLXrX0qZZXyLm4g38EwDVLlRcBqcpNex1mYY,545
|
|
117
116
|
scilens/utils/vectors.py,sha256=4N2BZSC5n3HgZqPujDGF5NdjVmSL1rOHb_qw4OoABQY,103
|
|
118
117
|
scilens/utils/web.py,sha256=MAFWpIFOKz7QhqDoFh-Qwstvc76KpcxstSgHFT8FOL4,901
|
|
119
|
-
scilens-0.4.
|
|
120
|
-
scilens-0.4.
|
|
121
|
-
scilens-0.4.
|
|
122
|
-
scilens-0.4.
|
|
118
|
+
scilens-0.4.11.dist-info/METADATA,sha256=podUjjzOmVM9UI_JwIGhiuqoLIOMmpVX3CuQZyKQ_Js,1368
|
|
119
|
+
scilens-0.4.11.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
120
|
+
scilens-0.4.11.dist-info/entry_points.txt,sha256=DaKGgxUEUv34GJAoXtta6ecL37ercejep9sCSSRQK2s,48
|
|
121
|
+
scilens-0.4.11.dist-info/RECORD,,
|
scilens/report/template.py
DELETED
|
@@ -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)
|
|
File without changes
|
|
File without changes
|