From 1bc29d7abf48a7ed698fe39f1e8a97fccaa1622b Mon Sep 17 00:00:00 2001 From: Brendan Jackman Date: Tue, 25 Apr 2017 15:56:14 +0100 Subject: [PATCH] instrument: Fix get_channels method - `Instrument.channels` is a dictionary, we want the values not the keys; this is provded by `list_channels`. - `InstrumentChannel` objects do not have a `measure` attribute. Use `kind` instead. --- devlib/instrument/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devlib/instrument/__init__.py b/devlib/instrument/__init__.py index 8defbbc..5b056c0 100644 --- a/devlib/instrument/__init__.py +++ b/devlib/instrument/__init__.py @@ -179,7 +179,7 @@ class Instrument(object): def get_channels(self, measure): if hasattr(measure, 'name'): measure = measure.name - return [c for c in self.channels if c.measure.name == measure] + return [c for c in self.list_channels() if c.kind == measure] def add_channel(self, site, measure, name=None, **attrs): if name is None: