Exemplo n.º 1
0
def test_histograms_with_all():
    df = results.get_histograms(r,
                                include_attrs=True,
                                include_itervars=True,
                                include_runattrs=True,
                                include_param_assignments=True,
                                include_config_entries=True)
    _assert_sequential_index(df)
    _assert(sanitize_and_compare_csv(df, "histograms_with_all.csv"),
            "content mismatch")
Exemplo n.º 2
0
from omnetpp.scave import results, chart

params = chart.get_configured_properties()

# This expression selects the results

filter_expression = params["filter"]

# The data is returned as a Pandas DataFrame
df = results.get_histograms(filter_expression, include_attrs=True, include_itervars=True)

# You can perform any transformations on the data here

print(df)
# Finally, the results are plotted
chart.plot_histograms(df)

chart.copy_properties()
Exemplo n.º 3
0
from omnetpp.scave import results, chart, utils, plot
import matplotlib.pyplot as plt
import pandas as pd

props = chart.get_properties()
utils.preconfigure_plot(props)

stats = results.get_statistics(props["filter"],
                               include_attrs=True,
                               include_runattrs=True,
                               include_itervars=True)
hists = results.get_histograms(props["filter"],
                               include_attrs=True,
                               include_runattrs=True,
                               include_itervars=True)

df = pd.concat([stats, hists], sort=False)

if df.empty:
    plot.set_warning("The result filter returned no data.")
    exit(1)

title, legend = utils.extract_label_columns(df)

df.sort_values(by=[l for i, l in legend], axis='index', inplace=True)

ax = plt.gca()

# This is how much of the standard deviation will give the 25th and 75th
# percentiles, assuming normal distribution.
# >>> math.sqrt(2) * scipy.special.erfinv(0.5)
Exemplo n.º 4
0
def test_histograms_with_attrs():
    df = results.get_histograms(r, include_attrs=True)
    _assert_sequential_index(df)
    _assert(sanitize_and_compare_csv(df, "histograms_with_attrs.csv"),
            "content mismatch")
Exemplo n.º 5
0
def test_histograms():
    df = results.get_histograms(r)
    _assert_sequential_index(df)
    _assert(sanitize_and_compare_csv(df, "histograms.csv"), "content mismatch")