mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-22 21:14:55 +00:00
lf_qa.py : whitespace updates
Tested Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
@@ -271,9 +271,11 @@ class csv_sql():
|
|||||||
try:
|
try:
|
||||||
self.df.to_sql(self.table, self.conn, if_exists='append')
|
self.df.to_sql(self.table, self.conn, if_exists='append')
|
||||||
except BaseException:
|
except BaseException:
|
||||||
print("attempt to append to database with different column layout, caused an exception, input new name --database <new name>")
|
print("attempt to append to database with different column layout,\
|
||||||
|
caused an exception, input new name --database <new name>")
|
||||||
print(
|
print(
|
||||||
"Error attempt to append to database with different column layout, caused an exception, input new name --database <new name>",
|
"Error attempt to append to database with different column layout,\
|
||||||
|
caused an exception, input new name --database <new name>",
|
||||||
file=sys.stderr)
|
file=sys.stderr)
|
||||||
exit(1)
|
exit(1)
|
||||||
self.conn.close()
|
self.conn.close()
|
||||||
@@ -353,6 +355,7 @@ class csv_sql():
|
|||||||
|
|
||||||
# prior to 5.4.3 there was not test-tag, the test tag is in the meta data
|
# prior to 5.4.3 there was not test-tag, the test tag is in the meta data
|
||||||
# print("dataframe df3 {df3}".format(df3=df3))
|
# print("dataframe df3 {df3}".format(df3=df3))
|
||||||
|
|
||||||
test_tag_list = list(df3['test-tag'])
|
test_tag_list = list(df3['test-tag'])
|
||||||
test_tag_list = list(set(test_tag_list))
|
test_tag_list = list(set(test_tag_list))
|
||||||
# print("test_tag_list: {}".format(test_tag_list) )
|
# print("test_tag_list: {}".format(test_tag_list) )
|
||||||
@@ -450,9 +453,6 @@ class csv_sql():
|
|||||||
kpi_path_list=kpi_path_list,
|
kpi_path_list=kpi_path_list,
|
||||||
kpi_fig=kpi_fig)
|
kpi_fig=kpi_fig)
|
||||||
|
|
||||||
#kpi_fig = (px.bar(df_tmp, x="Date", y=["Subtest-Pass","Subtest-Fail"], title="This is the title"))
|
|
||||||
#kpi_fig = (px.bar(df_tmp, x="Date", y="Subtest-Pass", title="This is the title"))
|
|
||||||
|
|
||||||
df_tmp["Percent"] = df_tmp["Subtest-Pass"] / \
|
df_tmp["Percent"] = df_tmp["Subtest-Pass"] / \
|
||||||
(df_tmp["Subtest-Pass"] +
|
(df_tmp["Subtest-Pass"] +
|
||||||
df_tmp["Subtest-Fail"])
|
df_tmp["Subtest-Fail"])
|
||||||
@@ -480,9 +480,10 @@ class csv_sql():
|
|||||||
"Subtest-Fail: %{customdata[3]}"
|
"Subtest-Fail: %{customdata[3]}"
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
|
'''
|
||||||
#kpi_fig = go.Figure(data=fig1.data + fig2.data)
|
kpi_fig = go.Figure(data=fig1.data + fig2.data)
|
||||||
# the kpi_fig is a go.Figure
|
the kpi_fig is a go.Figure
|
||||||
|
'''
|
||||||
kpi_fig = go.Figure(data=fig1.data)
|
kpi_fig = go.Figure(data=fig1.data)
|
||||||
kpi_fig.update_layout(yaxis=dict(tickformat='.2%'))
|
kpi_fig.update_layout(yaxis=dict(tickformat='.2%'))
|
||||||
kpi_fig.update_layout(
|
kpi_fig.update_layout(
|
||||||
@@ -596,18 +597,23 @@ Usage: lf_qa.py --store --png --path <path to directories to traverse> --databas
|
|||||||
__dir = args.dir
|
__dir = args.dir
|
||||||
__cut = args.cut
|
__cut = args.cut
|
||||||
|
|
||||||
print("config: path:{path} file:{file} database:{database} table:{table} server:{server} store:{store} png:{png}" .format(
|
print("config:\
|
||||||
path=__path, file=__file, database=__database, table=__table, server=__server, store=args.store, png=args.png))
|
path:{path} file:{file}\
|
||||||
|
database:{database} table:{table} \
|
||||||
|
server:{server} store:{store} png:{png}" .format(
|
||||||
|
path=__path, file=__file,
|
||||||
|
database=__database, table=__table,
|
||||||
|
server=__server, store=args.store, png=args.png))
|
||||||
|
|
||||||
if(__path == '' and args.store):
|
if(__path == '' and args.store):
|
||||||
print("--path <path of kpi.csv> must be entered if --store , exiting")
|
print("--path <path of kpi.csv> must be entered if --store , exiting")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
if(args.png and args.store == False):
|
if(args.png and args.store is False):
|
||||||
print("if --png set to create png files then --store must also be set, exiting")
|
print("if --png set to create png files then --store must also be set, exiting")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
if args.store == False and args.png == False:
|
if args.store is False and args.png is False:
|
||||||
print("Need to enter an action of --store --png ")
|
print("Need to enter an action of --store --png ")
|
||||||
|
|
||||||
# create report class for reporting
|
# create report class for reporting
|
||||||
|
|||||||
Reference in New Issue
Block a user