asv.graph¶
Attributes¶
Classes¶
Functions¶
|
|
|
|
Given a multiple input series: |
|
|
Fill missing data to series by linearly interpolating inside gaps |
|
Combine data series from multiple graphs to compatible form |
|
Module Contents¶
- 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.
- 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.
- 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_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.