Skip to content

Commit

Permalink
showcases: eliminate invalid escape sequence warning in anf files
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgeorge309 committed Jul 18, 2024
1 parent 54d6840 commit 6b53048
Show file tree
Hide file tree
Showing 12 changed files with 98 additions and 98 deletions.
2 changes: 1 addition & 1 deletion python/inet/scave/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ def add_to_dataframe(df, style_tuple_list=None, default_dict=None, order=None):
or
order = ['configname', 'Advanced_config', 'Default_config', 'Manual_config']
Note that the value parameter in style_tuple_list and the order can contain regex (e.g. .*foo). Make sure to escape regex characters such as [ and ] with \
Note that the value parameter in style_tuple_list and the order can contain regex (e.g. .*foo). Make sure to escape regex characters such as [ and ] with \\
"""


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4624,7 +4624,7 @@ if df.empty:
# apply vector operations
df = utils.perform_vector_ops(df, props["vector_operations"])
df['legend'] = df['module'].map(lambda module: re.sub(".*\.(.*)\..*", "\\1", module))
df['legend'] = df['module'].map(lambda module: re.sub(".*\\.(.*)\\..*", "\\1", module))
# plot
utils.plot_vectors(df, props)
Expand Down Expand Up @@ -5198,7 +5198,7 @@ if df.empty:
# apply vector operations
df = utils.perform_vector_ops(df, props["vector_operations"])
df['legend'] = df['module'].map(lambda module: re.sub(".*\.(.*)\..*", "\\1", module))
df['legend'] = df['module'].map(lambda module: re.sub(".*\\.(.*)\\..*", "\\1", module))
# plot
utils.plot_vectors(df, props)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<input pattern="/inet/showcases/tsn/gatescheduling/eager/results/Eager-*.sca"/>
</inputs>
<charts>
<chart icon="icons/full/obj/linechart.png" id="1635758751" name="Application End-to-End Delay" template="linechart_native" type="LINE">
<chart icon="icons/full/obj/linechart.png" id="1057960291" name="Application End-to-End Delay" template="linechart_native" type="LINE">
<script><![CDATA[import math
from omnetpp.scave import results, chart, utils
import os
Expand Down Expand Up @@ -36,10 +36,10 @@ if df.empty:
# apply vector operations
df = utils.perform_vector_ops(df, props["vector_operations"])
style_tuple_list = [('module', '.*app\[0\].*', {'marker': 'd', 'markersize': 4}),
('module', '.*app\[1\].*', {'marker': 'x', 'markersize': 2}),
('module', '.*app\[2\].*', {'marker': 'd', 'markersize': 4}),
('module', '.*app\[3\].*', {'marker': 's', 'markersize': 2})]
style_tuple_list = [('module', '.*app\\[0\\].*', {'marker': 'd', 'markersize': 4}),
('module', '.*app\\[1\\].*', {'marker': 'x', 'markersize': 2}),
('module', '.*app\\[2\\].*', {'marker': 'd', 'markersize': 4}),
('module', '.*app\\[3\\].*', {'marker': 's', 'markersize': 2})]
order = ['module', {'TsnDumbbellNetwork.server2.app[2].sink': 2,
'TsnDumbbellNetwork.server2.app[3].sink': 3,
Expand Down
16 changes: 8 additions & 8 deletions showcases/tsn/gatescheduling/sat/SatShowcase.anf
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ if df.empty:
# apply vector operations
df = utils.perform_vector_ops(df, props["vector_operations"])
style_tuple_list = [('module', '.*app\[0\].*', {'marker': 'd', 'markersize': 4}),
('module', '.*app\[1\].*', {'marker': 'x', 'markersize': 2}),
('module', '.*app\[2\].*', {'marker': 'd', 'markersize': 4}),
('module', '.*app\[3\].*', {'marker': 's', 'markersize': 2})]
style_tuple_list = [('module', '.*app\\[0\\].*', {'marker': 'd', 'markersize': 4}),
('module', '.*app\\[1\\].*', {'marker': 'x', 'markersize': 2}),
('module', '.*app\\[2\\].*', {'marker': 'd', 'markersize': 4}),
('module', '.*app\\[3\\].*', {'marker': 's', 'markersize': 2})]
order = ['module', {'TsnDumbbellNetwork.server2.app[2].sink': 2,
'TsnDumbbellNetwork.server2.app[3].sink': 3,
Expand Down Expand Up @@ -716,10 +716,10 @@ df_sat= utils.perform_vector_ops(df_sat, props["vector_operations"])
#print(df_eager, df_sat)
style_tuple_list = [('module', '.*app\[0\].*', {'marker': 'd', 'markersize': 4, 'color': '#1f77b4'}),
('module', '.*app\[1\].*', {'marker': 'x', 'markersize': 2, 'color': '#ff7f0e'}),
('module', '.*app\[2\].*', {'marker': 'd', 'markersize': 4, 'color': '#2ca02c'}),
('module', '.*app\[3\].*', {'marker': 's', 'markersize': 2, 'color': '#d62728'})]
style_tuple_list = [('module', '.*app\\[0\\].*', {'marker': 'd', 'markersize': 4, 'color': '#1f77b4'}),
('module', '.*app\\[1\\].*', {'marker': 'x', 'markersize': 2, 'color': '#ff7f0e'}),
('module', '.*app\\[2\\].*', {'marker': 'd', 'markersize': 4, 'color': '#2ca02c'}),
('module', '.*app\\[3\\].*', {'marker': 's', 'markersize': 2, 'color': '#d62728'})]
#style_tuple_list = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ if df.empty:
# apply vector operations
df = utils.perform_vector_ops(df, props["vector_operations"])
df['title'] = df['title'].map(lambda title: re.sub("\, vector.*", "", title))
df['title'] = df['title'].map(lambda title: re.sub("\\, vector.*", "", title))
# plot
utils.plot_vectors(df, props)
Expand Down Expand Up @@ -1239,7 +1239,7 @@ if df.empty:
# apply vector operations
df = utils.perform_vector_ops(df, props["vector_operations"])
df['title'] = df['title'].map(lambda title: re.sub("\, vector.*", "", title))
df['title'] = df['title'].map(lambda title: re.sub("\\, vector.*", "", title))
# plot
utils.plot_vectors(df, props)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if df.empty:
# apply vector operations
df = utils.perform_vector_ops(df, props["vector_operations"])
df['title'] = df['title'].map(lambda title: re.sub("\, vector.*", "", title))
df['title'] = df['title'].map(lambda title: re.sub("\\, vector.*", "", title))
# plot
utils.plot_vectors(df, props)
Expand Down Expand Up @@ -667,7 +667,7 @@ if df.empty:
# apply vector operations
df = utils.perform_vector_ops(df, props["vector_operations"])
df['title'] = df['title'].map(lambda title: re.sub("\, vector.*", "", title))
df['title'] = df['title'].map(lambda title: re.sub("\\, vector.*", "", title))
# plot
utils.plot_vectors(df, props)
Expand Down Expand Up @@ -1304,7 +1304,7 @@ if df.empty:
# apply vector operations
df = utils.perform_vector_ops(df, props["vector_operations"])
df['title'] = df['title'].map(lambda title: re.sub("\, vector.*", "", title))
df['title'] = df['title'].map(lambda title: re.sub("\\, vector.*", "", title))
# plot
utils.plot_vectors(df, props)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<input pattern="results/General-#0.vec"/>
</inputs>
<charts>
<chart createdWith="OMNeT++ 7.0.0.230207-439c415f65" icon="icons/full/obj/linechart.png" id="678787873" name="Client Application and Filter Incoming Data Rate" resultTypes="vector" template="linechart_mpl" type="MATPLOTLIB">
<chart icon="icons/full/obj/linechart.png" id="678787873" name="Client Application and Filter Incoming Data Rate" template="linechart_mpl" type="MATPLOTLIB">
<script><![CDATA[import math
from omnetpp.scave import results, chart, utils
import os
Expand Down Expand Up @@ -37,8 +37,8 @@ if df.empty:
# apply vector operations
df = utils.perform_vector_ops(df, props["vector_operations"])
inet.scave.plot.add_to_dataframe(df, style_tuple_list=[('module', '.*app\[0\]|.*filter\[0\]', {'color': default_colors[0]}),
('module', '.*app\[1\]|.*filter\[1\]', {'color': default_colors[1]}),
inet.scave.plot.add_to_dataframe(df, style_tuple_list=[('module', '.*app\\[0\\]|.*filter\\[0\\]', {'color': default_colors[0]}),
('module', '.*app\\[1\\]|.*filter\\[1\\]', {'color': default_colors[1]}),
('module', '.*client.*', {'linestyle': 'dotted'})])
# plot
Expand Down Expand Up @@ -651,7 +651,7 @@ utils.export_data_if_needed(df, props)
<property name="matplotlibrc" value="savefig.transparent : True"/>
<property name="include_fields" value="false"/>
</chart>
<chart createdWith="" icon="icons/full/obj/linechart.png" id="182658708" name="Filter incoming, outgoing and dropped data rate" resultTypes="" template="linechart_mpl" type="MATPLOTLIB">
<chart icon="icons/full/obj/linechart.png" id="182658708" name="Filter incoming, outgoing and dropped data rate" template="linechart_mpl" type="MATPLOTLIB">
<script><![CDATA[import math
from omnetpp.scave import results, chart, utils
import os
Expand Down Expand Up @@ -684,8 +684,8 @@ if df.empty:
df = utils.perform_vector_ops(df, props["vector_operations"])
style_tuple_list = [('name','.*incoming.*', {'linestyle': 'dotted'}),
('module','.*(filter\[0\]|queue\[0\]).*', {'color': default_colors[0]}),
('module','.*(filter\[1\]|queue\[1\]).*', {'color': default_colors[1]}),
('module','.*(filter\\[0\\]|queue\\[0\\]).*', {'color': default_colors[0]}),
('module','.*(filter\\[1\\]|queue\\[1\\]).*', {'color': default_colors[1]}),
('name','.*dropped.*', {'linestyle': 'dashed'})]
inet.scave.plot.add_to_dataframe(df, style_tuple_list)
Expand Down Expand Up @@ -1314,7 +1314,7 @@ utils.export_data_if_needed(df, props)
<property name="matplotlibrc" value="savefig.transparent : True&#10;figure.autolayout : True"/>
<property name="include_fields" value="false"/>
</chart>
<chart createdWith="OMNeT++ 7.0.0.230207-439c415f65" icon="icons/full/obj/linechart.png" id="983061138" name="Queue incoming and outgoing data rate" resultTypes="vector" template="linechart_mpl" type="MATPLOTLIB">
<chart icon="icons/full/obj/linechart.png" id="983061138" name="Queue incoming and outgoing data rate" template="linechart_mpl" type="MATPLOTLIB">
<script><![CDATA[import math
from omnetpp.scave import results, chart, utils
import os
Expand Down Expand Up @@ -1346,8 +1346,8 @@ if df.empty:
# apply vector operations
df = utils.perform_vector_ops(df, props["vector_operations"])
style_tuple_list = [('module','.*(app\[0\]|queue\[0\]).*', {'color': default_colors[0]}),
('module','.*(app\[1\]|queue\[1\]).*', {'color': default_colors[1]}),
style_tuple_list = [('module','.*(app\\[0\\]|queue\\[0\\]).*', {'color': default_colors[0]}),
('module','.*(app\\[1\\]|queue\\[1\\]).*', {'color': default_colors[1]}),
('name','incoming.*', {'linestyle': 'dotted'})]
inet.scave.plot.add_to_dataframe(df, style_tuple_list)
Expand Down Expand Up @@ -1971,7 +1971,7 @@ utils.export_data_if_needed(df, props)
<property name="matplotlibrc" value="savefig.transparent : True&#10;figure.autolayout : True"/>
<property name="include_fields" value="false"/>
</chart>
<chart createdWith="" icon="icons/full/obj/linechart.png" id="453153400" name="Queue incoming and outgoing data rate, zoomed" resultTypes="" template="linechart_mpl" type="MATPLOTLIB">
<chart icon="icons/full/obj/linechart.png" id="453153400" name="Queue incoming and outgoing data rate, zoomed" template="linechart_mpl" type="MATPLOTLIB">
<script><![CDATA[import math
from omnetpp.scave import results, chart, utils
import os
Expand Down Expand Up @@ -2003,11 +2003,11 @@ if df.empty:
# apply vector operations
df = utils.perform_vector_ops(df, props["vector_operations"])
style_tuple_list = [('source','throughput\(packetPushStarted\)', {'linestyle': 'dotted'}),
('module','.*(app\[0\]|queue\[0\]).*', {'color': default_colors[0]}),
('module','.*(app\[1\]|queue\[1\]).*', {'color': default_colors[1]}),
('module','.*(filter\[0\]).*', {'color': default_colors[0], 'linestyle': 'dashed'}),
('module','.*(filter\[1\]).*', {'color': default_colors[1], 'linestyle': 'dashed'})]
style_tuple_list = [('source','throughput\\(packetPushStarted\\)', {'linestyle': 'dotted'}),
('module','.*(app\\[0\\]|queue\\[0\\]).*', {'color': default_colors[0]}),
('module','.*(app\\[1\\]|queue\\[1\\]).*', {'color': default_colors[1]}),
('module','.*(filter\\[0\\]).*', {'color': default_colors[0], 'linestyle': 'dashed'}),
('module','.*(filter\\[1\\]).*', {'color': default_colors[1], 'linestyle': 'dashed'})]
inet.scave.plot.add_to_dataframe(df, style_tuple_list)
Expand Down Expand Up @@ -2638,7 +2638,7 @@ utils.export_data_if_needed(df, props)
<property name="matplotlibrc" value="savefig.transparent : True"/>
<property name="include_fields" value="false"/>
</chart>
<chart createdWith="" icon="icons/full/obj/linechart.png" id="1095145658" name="Server Application and Queue Outgoing Traffic" resultTypes="" template="linechart_mpl" type="MATPLOTLIB">
<chart icon="icons/full/obj/linechart.png" id="1095145658" name="Server Application and Queue Outgoing Traffic" template="linechart_mpl" type="MATPLOTLIB">
<script><![CDATA[import math
from omnetpp.scave import results, chart, utils
import os
Expand Down Expand Up @@ -2670,9 +2670,9 @@ if df.empty:
# apply vector operations
df = utils.perform_vector_ops(df, props["vector_operations"])
style_tuple_list = [('module','TsnLinearNetwork.server.app\[.*\].sink', {'linestyle': '--'}),
('module','.*(app\[0\]|queue\[0\]).*', {'color': default_colors[0]}),
('module','.*(app\[1\]|queue\[1\]).*', {'color': default_colors[1]})]
style_tuple_list = [('module','TsnLinearNetwork.server.app\\[.*\\].sink', {'linestyle': '--'}),
('module','.*(app\\[0\\]|queue\\[0\\]).*', {'color': default_colors[0]}),
('module','.*(app\\[1\\]|queue\\[1\\]).*', {'color': default_colors[1]})]
inet.scave.plot.add_to_dataframe(df, style_tuple_list)
Expand Down Expand Up @@ -3295,7 +3295,7 @@ utils.export_data_if_needed(df, props)
<property name="matplotlibrc" value="savefig.transparent : True"/>
<property name="include_fields" value="false"/>
</chart>
<chart createdWith="OMNeT++ 7.0.0.230207-439c415f65" icon="icons/full/obj/linechart.png" id="1118731091" name="Filter and queue incoming and outgoing traffic + drop rate, best effort" resultTypes="vector" template="linechart_separate_mpl" type="MATPLOTLIB">
<chart icon="icons/full/obj/linechart.png" id="1118731091" name="Filter and queue incoming and outgoing traffic + drop rate, best effort" template="linechart_separate_mpl" type="MATPLOTLIB">
<script><![CDATA[import math
import matplotlib.pyplot as plt
from omnetpp.scave import results, chart, utils
Expand Down Expand Up @@ -3973,7 +3973,7 @@ utils.export_image_if_needed(props)
<property name="matplotlibrc" value="savefig.transparent : True&#10;figure.autolayout : True"/>
<property name="include_fields" value="false"/>
</chart>
<chart createdWith="OMNeT++ 7.0.0.230207-439c415f65" icon="icons/full/obj/linechart.png" id="396641951" name="Filter and queue incoming and outgoing traffic + drop rate, video" resultTypes="vector" template="linechart_separate_mpl" type="MATPLOTLIB">
<chart icon="icons/full/obj/linechart.png" id="396641951" name="Filter and queue incoming and outgoing traffic + drop rate, video" template="linechart_separate_mpl" type="MATPLOTLIB">
<script><![CDATA[import math
import matplotlib.pyplot as plt
from omnetpp.scave import results, chart, utils
Expand Down Expand Up @@ -4651,7 +4651,7 @@ utils.export_image_if_needed(props)
<property name="matplotlibrc" value="savefig.transparent : True&#10;figure.autolayout : True"/>
<property name="include_fields" value="false"/>
</chart>
<chart createdWith="OMNeT++ 7.0.0.230207-439c415f65" icon="icons/full/obj/linechart.png" id="1893942980" name="Queue remaining eligibility time" resultTypes="vector" template="linechart_mpl" type="MATPLOTLIB">
<chart icon="icons/full/obj/linechart.png" id="1893942980" name="Queue remaining eligibility time" template="linechart_mpl" type="MATPLOTLIB">
<script><![CDATA[import math
from omnetpp.scave import results, chart, utils
import os
Expand Down Expand Up @@ -5290,7 +5290,7 @@ utils.export_data_if_needed(df, props)
<property name="matplotlibrc" value="savefig.transparent : True"/>
<property name="include_fields" value="false"/>
</chart>
<chart createdWith="" icon="icons/full/obj/linechart.png" id="1874158300" name="Queue remaining eligibility time, zoomed" resultTypes="" template="linechart_native" type="LINE">
<chart icon="icons/full/obj/linechart.png" id="1874158300" name="Queue remaining eligibility time, zoomed" template="linechart_native" type="LINE">
<script><![CDATA[import math
from omnetpp.scave import results, chart, utils, ideplot
Expand Down Expand Up @@ -5931,7 +5931,7 @@ utils.export_data_if_needed(df, props)
<property name="legend_automatic" value="true"/>
<property name="legend_format" value=""/>
</chart>
<chart createdWith="" icon="icons/full/obj/linechart.png" id="1641514640" name="Traffic shaping" resultTypes="" template="linechart_separate_mpl" type="MATPLOTLIB">
<chart icon="icons/full/obj/linechart.png" id="1641514640" name="Traffic shaping" template="linechart_separate_mpl" type="MATPLOTLIB">
<script><![CDATA[import re
import numpy
import math
Expand Down Expand Up @@ -6004,7 +6004,7 @@ for i in df:
#df = utils.perform_vector_ops(df, props["vector_operations"])
#df["moduledisplaypath"].fillna(df["module"], inplace=True)
#df["legend"] = df["moduledisplaypath"] + ", " + df["title"]
#df["legend"] = df["legend"].apply(lambda legend: re.sub(".*\.(.*) dilated.*", "\\1", str(legend)))
#df["legend"] = df["legend"].apply(lambda legend: re.sub(".*\\.(.*) dilated.*", "\\1", str(legend)))
#df["title"] = df["legend"]
# plot
Expand Down Expand Up @@ -6647,7 +6647,7 @@ utils.export_data_if_needed(df, props)]]></script>
<property name="matplotlibrc" value="savefig.transparent : True"/>
<property name="include_fields" value="false"/>
</chart>
<chart createdWith="" icon="icons/full/obj/linechart.png" id="727250450" name="Traffic shaping, zoomed" resultTypes="" template="linechart_separate_mpl" type="MATPLOTLIB">
<chart icon="icons/full/obj/linechart.png" id="727250450" name="Traffic shaping, zoomed" template="linechart_separate_mpl" type="MATPLOTLIB">
<script><![CDATA[import re
import numpy
import math
Expand Down Expand Up @@ -6720,7 +6720,7 @@ for i in df:
#df = utils.perform_vector_ops(df, props["vector_operations"])
#df["moduledisplaypath"].fillna(df["module"], inplace=True)
#df["legend"] = df["moduledisplaypath"] + ", " + df["title"]
#df["legend"] = df["legend"].apply(lambda legend: re.sub(".*\.(.*) dilated.*", "\\1", str(legend)))
#df["legend"] = df["legend"].apply(lambda legend: re.sub(".*\\.(.*) dilated.*", "\\1", str(legend)))
#df["title"] = df["legend"]
# plot
Expand Down
8 changes: 4 additions & 4 deletions showcases/tsn/trafficshaping/cbsandats/CbsAndAtsShowcase.anf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<input pattern="results/General-#0.vec"/>
</inputs>
<charts>
<chart createdWith="" icon="icons/full/obj/linechart.png" id="793412994" name="Shaper Incoming And Outgoing Traffic" resultTypes="" template="linechart_mpl" type="MATPLOTLIB">
<chart icon="icons/full/obj/linechart.png" id="587404414" name="Shaper Incoming And Outgoing Traffic" template="linechart_mpl" type="MATPLOTLIB">
<script><![CDATA[import math
from omnetpp.scave import results, chart, utils
import os
Expand Down Expand Up @@ -37,9 +37,9 @@ if df.empty:
# apply vector operations
df = utils.perform_vector_ops(df, props["vector_operations"])
style_tuple_list = [('source', 'throughput\(packetPushStarted\)', {'linestyle': 'dashed'}),
('module', '.*(app\[0\]|queue\[0\]).*', {'color': default_colors[0]}),
('module', '.*(app\[1\]|queue\[1\]).*', {'color': default_colors[1]})]
style_tuple_list = [('source', 'throughput\\(packetPushStarted\\)', {'linestyle': 'dashed'}),
('module', '.*(app\\[0\\]|queue\\[0\\]).*', {'color': default_colors[0]}),
('module', '.*(app\\[1\\]|queue\\[1\\]).*', {'color': default_colors[1]})]
inet.scave.plot.add_to_dataframe(df, style_tuple_list)
Expand Down
Loading

0 comments on commit 6b53048

Please sign in to comment.