aboutsummaryrefslogtreecommitdiff
path: root/trappy/pid_controller.py
diff options
context:
space:
mode:
authorJavi Merino <javi.merino@arm.com>2015-12-07 15:05:13 +0000
committerJavi Merino <javi.merino@arm.com>2015-12-07 15:28:41 +0000
commitec2ffe0b266cc2107bc411f4a430af4e474562f6 (patch)
tree4cd3c928daa27fc57eb218cfda6bed551be7c7d7 /trappy/pid_controller.py
parent88dd0cfcaa66600fb70b966191be34d4cd47a160 (diff)
downloadtrappy-ec2ffe0b266cc2107bc411f4a430af4e474562f6.tar.gz
trappy: don't require matplotlib to be installed for stuff to run
Only import matplotlib or files that require matplotlib when functions that need it are called. This way, we can use trappy in a system that doesn't have matplotlib installed, if we use the subset of trappy that doesn't do plotting.
Diffstat (limited to 'trappy/pid_controller.py')
-rw-r--r--trappy/pid_controller.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/trappy/pid_controller.py b/trappy/pid_controller.py
index 3376b13..846ed54 100644
--- a/trappy/pid_controller.py
+++ b/trappy/pid_controller.py
@@ -18,7 +18,6 @@ current directory's trace.dat"""
from trappy.base import Base
from trappy.run import Run
-from trappy.plot_utils import normalize_title, pre_plot_setup, post_plot_setup
class PIDController(Base):
"""Process the power allocator PID controller data in a FTrace dump"""
@@ -48,12 +47,14 @@ class PIDController(Base):
:param height: The height of the plot
:type int: int
"""
- title = normalize_title("PID", title)
+ import trappy.plot_utils
+
+ title = trappy.plot_utils.normalize_title("PID", title)
if not ax:
- ax = pre_plot_setup(width, height)
+ ax = trappy.plot_utils.pre_plot_setup(width, height)
self.data_frame[["output", "p", "i", "d"]].plot(ax=ax)
- post_plot_setup(ax, title=title)
+ trappy.plot_utils.post_plot_setup(ax, title=title)
Run.register_class(PIDController, "thermal")