asv.graph

Attributes

Classes

GraphSet

Manage multiple Graph objects

Graph

Manages a single "line" in the resulting plots for the front end.

Functions

_compute_graph_steps(data[, reraise])

make_summary_graph(graphs)

_compute_summary_data_series(*ys)

Given a multiple input series:

_fill_missing_data(y[, max_gap_fraction])

Fill missing data to series by linearly interpolating inside gaps

_combine_graph_data(graphs)

Combine data series from multiple graphs to compatible form

resample_data(val[, num_points])

Module Contents

asv.graph.RESAMPLED_POINTS = 384.0[source]
class asv.graph.GraphSet[source]

Manage multiple Graph objects

_graphs[source]
_groups[source]
get_graph(benchmark_name, params)[source]
get_graph_group(benchmark_name)[source]
get_params()[source]

Return all params used in graphs and their corresponding values set

detect_steps(pool=None, dots=None)[source]
get_summary_graphs(dots=None)[source]
save(html_dir, dots=None)[source]
__iter__()[source]
__len__()[source]
class asv.graph.Graph(benchmark_name, params)[source]

Manages a single “line” in the resulting plots for the front end.

Unlike “results”, which contain the timings for a single commit, these contain the timings for a single benchmark.

benchmark_name[source]
params[source]
data_points[source]
data_weights[source]
path[source]
n_series = None[source]
scalar_series = True[source]
_steps = None[source]
classmethod get_file_path(params, benchmark_name)[source]

Get a file path understood by the JS frontend, corresponding on the given parameters and benchmark_name.

The implementation must match asv.js:graph_to_path

add_data_point(revision, value, weight=None)[source]

Add a data point to the graph.

Parameters

revisionint

An integer value representing the commit revision in the commit log

valuefloat or list

The value(s) to plot in the benchmark.

weightfloat or list or None

Weights corresponding to the values. Missing estimates are indicated with None.

get_data()[source]

Get the sorted and reduced data and weights.

save(html_dir)[source]

Save the graph to a .json file used by the frontend.

Parameters

html_dirstr

The root of the HTML tree.

detect_steps(pool=None)[source]

Run step detection algorithm on the graph data.

Afterward, the results can be obtained via get_steps()

Parameters

poolmultiprocessing.Pool, optional

Pool to use for asynchronous jobs. If not given, run in serial.

get_steps()[source]

Return results from step detection.

Returns

stepslist of (left, right, val, min, err)

Result of fitting a piecewise function to the graph. Missing data points do not necessarily belong in any piece. The values are: left (inclusive) and right (exclusive) specify a revision interval, val the median value in the interval, min the minimum value in the interval, and err the mean deviation from the median.

asv.graph._compute_graph_steps(data, reraise=True)[source]
asv.graph.make_summary_graph(graphs)[source]
asv.graph._compute_summary_data_series(*ys)[source]

Given a multiple input series:

y0, y1, ...

calculate summary data series:

val = [geom_mean([y0[0], y1[0], ...]),
       geom_mean([y0[1], y1[1], ...]),
      ...]

Missing data in each y-series is filled for each series separately, before averaging. Data points that are missing from all series are however marked missing.

asv.graph._fill_missing_data(y, max_gap_fraction=0.1)[source]

Fill missing data to series by linearly interpolating inside gaps that are smaller than max_gap_fraction of total available points.

asv.graph._combine_graph_data(graphs)[source]

Combine data series from multiple graphs to compatible form

Parameters

graphslist of Graph

Input data.

Returns

xlist of float

List of x-coordinates, in increasing order

yslist of list of float

List of data series, [y0, y1, y2, …], where y0, y1, y2, … are each lists of y-coordinates corresponding to x, one for each data series in each graph. When some of the graphs do not have data for a given x-value, the missing data is indicated by None values.

asv.graph.resample_data(val, num_points=RESAMPLED_POINTS)[source]