aboutsummaryrefslogtreecommitdiff
path: root/tests/test_plotter.py
AgeCommit message (Collapse)Author
2017-04-26AbstractDataPlotter: Improve error message for bad signal defBrendan Jackman
2017-01-04Update ARM Ltd. copyright to 2017Brendan Jackman
2016-07-17tests: add test for ILinePlotGen.df_to_dygraphKapileshwar Singh
Change-Id: I85327148401972ec477fd6c43889a487bc8ae083
2016-07-08plotter: ILinePlot: make _fix_indexes always return a dictionaryMichele Di Giorgio
Signed-off-by: Michele Di Giorgio <michele.digiorgio@arm.com>
2016-07-04Merge pull request #204 from JaviMerino/plotter_color_everywhere_v2Kapileshwar Singh
Plotter color everywhere v2
2016-07-04plotter: augment the signals spec to include colorsJavi Merino
Now that we have color support in all plots, augment the signal spec to have color as an additional third parameter. With this syntax, signal "thermal:temp:255,0,255" plots the temp column of the thermal trace in pink.
2016-07-04tests: More thorough testing of signalsJavi Merino
Make the signals test more thorough.
2016-07-04ILinePlot: learn to specify custom colorsJavi Merino
The static plotter accepts a colors parameter to change the colors of the lines. Let the ILinePlot accept the same argument with the same syntax so that we can customize the colors of the plots in the same way for all plots created by trappy.plotter.
2016-06-30plotter: show appropriate error when plotting a dataframe but column was not ↵Javi Merino
specified When you try to plot a dataframe without specifying the column, the code that checks it fails with KeyError: "column" Fix the check so that the appropriate error (ValueError: Column not specified for DataFrame input) is printed.
2016-04-28ILinePlot: don't call data_frame what's just a python dictJavi Merino
Since the dawn of time we have a "data_frame" variable in ILinePlot that is actually defined as a pd.Series() but it's acting as a dict. Rename it and turn the pd.Series into a dict, as it is simpler and it really is what this variable moves around.
2016-04-19ILinePlot: test independent series mergingMichele Di Giorgio
This tests checks the following: - given two data series with different indexes - ILinePlot will merge them using _fix_indexes - the set of indexes of the merged series must be the union of the set of indexes of the initial series
2016-03-15ILinePlot: fix merging with duplicate indexes in one of the dataframesJavi Merino
If one of the dataframes passed to ILinePlot have duplicate indexes, view() fails with File "/home/javi/src/trappy/trappy/tests/trappy/plotter/ILinePlot.py", line 151, in view self._plot(self._attr["permute"], test) File "/home/javi/src/trappy/trappy/tests/trappy/plotter/ILinePlot.py", line 199, in _plot data_frame = self._fix_indexes(data_frame) File "/home/javi/src/trappy/trappy/tests/trappy/plotter/ILinePlot.py", line 243, in _fix_indexes merged_df = pd.concat(data_frame.get_values(), axis=1) File "/usr/lib/python2.7/dist-packages/pandas/tools/merge.py", line 813, in concat return op.get_result() File "/usr/lib/python2.7/dist-packages/pandas/tools/merge.py", line 966, in get_result tmpdf = DataFrame(data, index=index) File "/usr/lib/python2.7/dist-packages/pandas/core/frame.py", line 226, in __init__ mgr = self._init_dict(data, index, columns, dtype=dtype) File "/usr/lib/python2.7/dist-packages/pandas/core/frame.py", line 363, in _init_dict dtype=dtype) File "/usr/lib/python2.7/dist-packages/pandas/core/frame.py", line 5163, in _arrays_to_mgr arrays = _homogenize(arrays, index, dtype) File "/usr/lib/python2.7/dist-packages/pandas/core/frame.py", line 5465, in _homogenize v = v.reindex(index, copy=False) File "/usr/lib/python2.7/dist-packages/pandas/core/series.py", line 2268, in reindex return super(Series, self).reindex(index=index, **kwargs) File "/usr/lib/python2.7/dist-packages/pandas/core/generic.py", line 1962, in reindex method, fill_value, copy).__finalize__(self) File "/usr/lib/python2.7/dist-packages/pandas/core/generic.py", line 1981, in _reindex_axes fill_value=fill_value, copy=copy, allow_dups=False) File "/usr/lib/python2.7/dist-packages/pandas/core/generic.py", line 2073, in _reindex_with_indexers copy=copy) File "/usr/lib/python2.7/dist-packages/pandas/core/internals.py", line 3503, in reindex_indexer self.axes[axis]._can_reindex(indexer) File "/usr/lib/python2.7/dist-packages/pandas/core/index.py", line 2086, in _can_reindex raise ValueError("cannot reindex from a duplicate axis") ValueError: cannot reindex from a duplicate axis Fix it by filtering the DataFrames through handle_duplicate_index() before merging them. Change-Id: I34e6af523d14e35c3a17652924fbaa5989c1243d
2016-03-15ILinePlot: learn to pass testsJavi Merino
Let view() parse the test parameter so that we can test ILinePlot from the testsuite. It's not a complete solution, but it's good enough to get us started. Change-Id: Ie0ce7a541b8714b579118143208b818277a585a6
2016-02-25tests: fix test_plot_filter() to make a plot with dataJavi Merino
The test for LinePlot with no pivot and filters uses a filter that leaves the dataframe empty. Change the filter so that it actually simulates creating a plot with actual data.
2016-01-29test: Add tests for BarPlotJavi Merino
A couple of simple tests to check that BarPlot doesn't bomb. Change-Id: Icb430f2ac75f1767de7e5b6e5f63f4fe0c9d6265
2016-01-15Fixed plotting of dataframesJohn Pocock
Changed self.templates to templates to fix plotting of dataframes.
2016-01-05trappy: update copyright to 2016Javi Merino
2015-12-22ftrace: rename Run to FTraceJavi Merino
Run is a very generic and inappropriate name for an object that parses the result of ftrace into a form consumable by python. Rename it to FTrace in preparation for its generalization.
2015-12-17plotter: teach get_trace_event_data() to deal with broken tracesJavi Merino
Sometimes traces have dropped events. That shouldn't make get_trace_event_data() die with an exception. Handle gracefully traces with dropped events by ignoring the pids that were scheduled in but the schedule out event was dropped.
2015-11-27tests: Add tests cases for signals input in plotter APIKapileshwar Singh
Signed-off-by: Kapileshwar Singh <kapileshwar.singh@arm.com>
2015-08-13trappy: rename to trappyJavi Merino
Change-Id: I7e0e34c9f5565e34629683bb29ab25cf5e737088
2015-08-13cr2: change copyright to Apache 2Javi Merino
Change-Id: Ie505af7efb7526f94b1cc9e37195cbd2e0451b9d
2015-08-13cr2: remove shebang from module filesJavi Merino
Change-Id: Ia27765444594448313b955a7808b3532fb89df50
2015-08-12cr2: rename power.py to cpu_power.pyJavi Merino
We're going to get gpu power information so clarify that InPower and OutPower refer to the cpu by prepending Cpu to their class names. Redo a couple of the docs that had that name on it while we are at it. Change-Id: If05882a7e8521d01cbd6b95370de3f92669b25a6 Signed-off-by: Javi Merino <javi.merino@arm.com>
2015-08-12tests: add copyright headers to all test filesJavi Merino
They are missing and we need them if we want to opensource this. Change-Id: I456ecd5ac5e33c7ada234f490389572d8932090b Signed-off-by: Javi Merino <javi.merino@arm.com>
2015-08-12Add a test argument to view method for LinePlot.Kapileshwar Singh
The default configuration for Plotter is interactive in AttrConf.MPL_STYLE which sets the matplotlib context as interactive. This calls the pyplot.draw() method that invokes the image rendering even if the user's code does not call .draw() or .show() explicitly. We disable interactive for our tests Change-Id: Ia62ef7700d00d61614aafe1472d0d36a6cbef7b8 Signed-off-by: Kapileshwar Singh <kapileshwar.singh@arm.com>
2015-08-12Add a method to save the image for the graphsKapileshwar Singh
As a feature request by Juri PlotLayout also handles the excess whitespaces in images with boundary condition checks that are added In order to handle white spaces preveiously the PlotLayout was adding an extra row for single graphs so that the axes can be indexed in a 2D array This extra row does not show up in QT or ipython frontends but shows up in saved images. The plot layout now handles single plots differently and the logic for getting an axes corresponding to an index is encapsulated within the PlotLayout object so that the DataPlotters need not bother about it. The modulo arithmetic change ensures that an extra row is not added and the columns are clipped to num_plots if the user gives a larger per_line value Change-Id: Ic972c750573ceacbd2c12a95648dd67449713637 Signed-off-by: Kapileshwar Singh <kapileshwar.singh@arm.com>
2015-08-12tests: plotter: Modifications for change in column namesKapileshwar Singh
The InPower Event Class has dynamic_power and static_power column and OutPower has a single power column. This change handles the different column names Change-Id: I9317e1b4ce74ec01f589b5a3ed283fbe3c4652af Signed-off-by: Kapileshwar Singh <kapileshwar.singh@arm.com>
2015-08-12Plotter Code for CR2 (Pivoted and filtered Plots)KP Singh
Change-Id: I79b06f46cd67e2a0be456a9093658a461db96e4f Signed-off-by: KP Singh <kapileshwar.singh@arm.com>