devfreq_power: return a DataFrame in get_all_freqs, like cpu_power do
Devfreq{In,Out}Power.get_all_freqs() should behave like
Cpu{In,Out}Power. Make it return a DataFrame instead of a Series.
Apart from making it consistent, in pandas < 0.14, concatenating
DataFrame and Series raises a TypeError. This fixes it.
Change-Id: Ib33408ff9dd475134a01813c822a483303df24a3
diff --git a/cr2/devfreq_power.py b/cr2/devfreq_power.py
index e09bbd6..23449cf 100644
--- a/cr2/devfreq_power.py
+++ b/cr2/devfreq_power.py
@@ -16,6 +16,8 @@
"""Process the output of the devfreq_cooling devices in the current
directory's trace.dat"""
+import pandas as pd
+
from cr2.base import Base
from cr2.run import Run
@@ -32,14 +34,14 @@
)
def get_all_freqs(self):
- """Return a pandas.Series with the frequencies for the devfreq device
+ """Return a pandas.DataFrame with the frequencies for the devfreq device
The format should be the same as the one for
CpuInPower().get_all_freqs(). Frequencies are in MHz.
"""
- return self.data_frame["freq"] / 1000000
+ return pd.DataFrame(self.data_frame["freq"] / 1000000)
Run.register_class(DevfreqInPower, "thermal")
@@ -56,7 +58,7 @@
)
def get_all_freqs(self):
- """Return a pandas.Series with the output frequencies for the devfreq
+ """Return a pandas.DataFrame with the output frequencies for the devfreq
device
The format should be the same that that of
@@ -64,6 +66,6 @@
"""
- return self.data_frame["freq"] / 1000000
+ return pd.DataFrame(self.data_frame["freq"] / 1000000)
Run.register_class(DevfreqOutPower, "thermal")