Skip to content

Commit

Permalink
showcases: fix FutureWarning: ChainedAssignmentError in anf files
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgeorge309 committed Jul 17, 2024
1 parent 94d7923 commit 54d6840
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
36 changes: 18 additions & 18 deletions showcases/tsn/timesynchronization/clockdrift/ClockDriftShowcase.anf
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ df = utils.perform_vector_ops(df, props["vector_operations"])
df['legend'] = df['module']
for i in range(0,len(df['legend'])):
df['legend'][i] = df['module'][i].replace('ClockDriftShowcase.','')
df['legend'][i] = df['legend'][i].replace('.clock','')
df.loc[i, 'legend'] = df.loc[i, 'module'].replace('ClockDriftShowcase.','')
df.loc[i, 'legend'] = df.loc[i, 'legend'].replace('.clock','')
# plot
utils.plot_vectors(df, props)
Expand Down Expand Up @@ -629,8 +629,8 @@ df = utils.perform_vector_ops(df, props["vector_operations"])
df['legend'] = df['module']
for i in range(0,len(df['legend'])):
df['legend'][i] = df['module'][i].replace('ClockDriftShowcase.','')
df['legend'][i] = df['legend'][i].replace('.clock','')
df.loc[i, 'legend'] = df.loc[i, 'module'].replace('ClockDriftShowcase.','')
df.loc[i, 'legend'] = df.loc[i, 'legend'].replace('.clock','')
# plot
utils.plot_vectors(df, props)
Expand Down Expand Up @@ -1210,8 +1210,8 @@ df = utils.perform_vector_ops(df, props["vector_operations"])
df['legend'] = df['module']
for i in range(0,len(df['legend'])):
df['legend'][i] = df['module'][i].replace('ClockDriftShowcase.','')
df['legend'][i] = df['legend'][i].replace('.clock','')
df.loc[i, 'legend'] = df.loc[i, 'module'].replace('ClockDriftShowcase.','')
df.loc[i, 'legend'] = df.loc[i, 'legend'].replace('.clock','')
# plot
utils.plot_vectors(df, props)
Expand Down Expand Up @@ -1791,8 +1791,8 @@ df = utils.perform_vector_ops(df, props["vector_operations"])
df['legend'] = df['module']
for i in range(0,len(df['legend'])):
df['legend'][i] = df['module'][i].replace('ClockDriftShowcase.','')
df['legend'][i] = df['legend'][i].replace('.clock','')
df.loc[i, 'legend'] = df.loc[i, 'module'].replace('ClockDriftShowcase.','')
df.loc[i, 'legend'] = df.loc[i, 'legend'].replace('.clock','')
# plot
utils.plot_vectors(df, props)
Expand Down Expand Up @@ -2372,8 +2372,8 @@ df = utils.perform_vector_ops(df, props["vector_operations"])
df['legend'] = df['module']
for i in range(0,len(df['legend'])):
df['legend'][i] = df['module'][i].replace('ClockDriftShowcase.','')
df['legend'][i] = df['legend'][i].replace('.clock','')
df.loc[i, 'legend'] = df.loc[i, 'module'].replace('ClockDriftShowcase.','')
df.loc[i, 'legend'] = df.loc[i, 'legend'].replace('.clock','')
# plot
utils.plot_vectors(df, props)
Expand Down Expand Up @@ -2953,8 +2953,8 @@ df = utils.perform_vector_ops(df, props["vector_operations"])
df['legend'] = df['module']
for i in range(0,len(df['legend'])):
df['legend'][i] = df['module'][i].replace('ClockDriftShowcase.','')
df['legend'][i] = df['legend'][i].replace('.clock','')
df.loc[i, 'legend'] = df.loc[i, 'module'].replace('ClockDriftShowcase.','')
df.loc[i, 'legend'] = df.loc[i, 'legend'].replace('.clock','')
# plot
utils.plot_vectors(df, props)
Expand Down Expand Up @@ -3534,8 +3534,8 @@ df = utils.perform_vector_ops(df, props["vector_operations"])
df['legend'] = df['module']
for i in range(0,len(df['legend'])):
df['legend'][i] = df['module'][i].replace('ClockDriftShowcase.','')
df['legend'][i] = df['legend'][i].replace('.clock','')
df.loc[i, 'legend'] = df.loc[i, 'module'].replace('ClockDriftShowcase.','')
df.loc[i, 'legend'] = df.loc[i, 'legend'].replace('.clock','')
# plot
utils.plot_vectors(df, props)
Expand Down Expand Up @@ -4117,8 +4117,8 @@ df = utils.perform_vector_ops(df, props["vector_operations"])
df['legend'] = df['module']
for i in range(0,len(df['legend'])):
df['legend'][i] = df['module'][i].replace('ClockDriftShowcase.','')
df['legend'][i] = df['legend'][i].replace('.clock','')
df.loc[i, 'legend'] = df.loc[i, 'module'].replace('ClockDriftShowcase.','')
df.loc[i, 'legend'] = df.loc[i, 'legend'].replace('.clock','')
# plot
utils.plot_vectors(df, props)
Expand Down Expand Up @@ -4698,8 +4698,8 @@ df = utils.perform_vector_ops(df, props["vector_operations"])
df['legend'] = df['module']
for i in range(0,len(df['legend'])):
df['legend'][i] = df['module'][i].replace('ClockDriftShowcase.','')
df['legend'][i] = df['legend'][i].replace('.clock','')
df.loc[i, 'legend'] = df.loc[i, 'module'].replace('ClockDriftShowcase.','')
df.loc[i, 'legend'] = df.loc[i, 'legend'].replace('.clock','')
# plot
utils.plot_vectors(df, props)
Expand Down
16 changes: 8 additions & 8 deletions showcases/tsn/timesynchronization/gptp/GptpShowcase.anf
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ if df.empty:
df['legend'] = df['module']
for i in range(0,len(df)):
df['legend'][i] = df['legend'][i].replace("OneMasterClockGptpShowcase.","")
df['legend'][i] = df['legend'][i].replace(".clock","")
df.loc[i, 'legend'] = df.loc[i, 'legend'].replace("OneMasterClockGptpShowcase.","")
df.loc[i, 'legend'] = df.loc[i, 'legend'].replace(".clock","")
# apply vector operations
df = utils.perform_vector_ops(df, props["vector_operations"])
Expand Down Expand Up @@ -628,8 +628,8 @@ df = utils.perform_vector_ops(df, props["vector_operations"])
df['legend'] = df['module']
for i in range(0,len(df)):
df['legend'][i] = df['legend'][i].replace("TwoMasterClocksTreeGptpShowcase.","")
# df['legend'][i] = df['legend'][i].replace(".clock","")
df.loc[i, 'legend'] = df.loc[i, 'legend'].replace("TwoMasterClocksTreeGptpShowcase.","")
# df.loc[i, 'legend'] = df.loc[i, 'legend'].replace(".clock","")
# plot
utils.plot_vectors(df, props)
Expand Down Expand Up @@ -1204,8 +1204,8 @@ df = utils.perform_vector_ops(df, props["vector_operations"])
df['legend'] = df['module']
for i in range(0,len(df)):
df['legend'][i] = df['legend'][i].replace("TwoMasterClocksTreeGptpShowcase.","")
# df['legend'][i] = df['legend'][i].replace(".clock[0]","")
df.loc[i, 'legend'] = df.loc[i, 'legend'].replace("TwoMasterClocksTreeGptpShowcase.","")
# df.loc[i, 'legend'] = df.loc[i, 'legend'].replace(".clock[0]","")
# plot
utils.plot_vectors(df, props)
Expand Down Expand Up @@ -1780,8 +1780,8 @@ df = utils.perform_vector_ops(df, props["vector_operations"])
df['legend'] = df['module']
for i in range(0,len(df)):
df['legend'][i] = df['legend'][i].replace("TwoMasterClocksTreeGptpShowcase.","")
# df['legend'][i] = df['legend'][i].replace(".clock[0]","")
df.loc[i, 'legend'] = df.loc[i, 'legend'].replace("TwoMasterClocksTreeGptpShowcase.","")
# df.loc[i, 'legend'] = df.loc[i, 'legend'].replace(".clock[0]","")
# plot
utils.plot_vectors(df, props)
Expand Down
2 changes: 1 addition & 1 deletion showcases/wireless/errorrate/ErrorRate.anf
Original file line number Diff line number Diff line change
Expand Up @@ -1990,7 +1990,7 @@ if df.empty:
for i in range(len(df['value'])):
# avoid SettingWithCopyWarning
value = df['value'].copy()
value[i] = float(df['bitrate'][i]) * (1 - float(df['value'][i]))
value[i] = float(df.loc[i, 'bitrate']) * (1 - float(df.loc[i, 'value']))
df['value'] = value
xaxis_itervar, group_by = utils.select_xaxis_and_groupby(df, props)
Expand Down

0 comments on commit 54d6840

Please sign in to comment.