From 76af2a377c852af7ef90ea8fca42d9f26e3e10bb Mon Sep 17 00:00:00 2001 From: Sebastian Pauka Date: Tue, 11 Apr 2017 11:18:20 +1000 Subject: [PATCH] fix: bug in slicing and adding code Fix bug in slicing/adding code, not correctly passing along channel list name. --- qcodes/instrument/channel.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qcodes/instrument/channel.py b/qcodes/instrument/channel.py index f4ca73e7243..539b518fb58 100644 --- a/qcodes/instrument/channel.py +++ b/qcodes/instrument/channel.py @@ -109,6 +109,7 @@ def __init__(self, parent, name, chan_type, chan_list=None): self._parent = parent self._name = name if type(chan_type) != type or not issubclass(chan_type, InstrumentChannel): + print(chan_type, InstrumentChannel) raise ValueError("Channel Lists can only hold instances of type InstrumentChannel") self._chan_type = chan_type @@ -131,7 +132,7 @@ def __getitem__(self, i): i (int/slice): Either a single channel index or a slice of channels to get """ if isinstance(i, slice): - return ChannelList(self._parent, self._chan_type, self._channels[i]) + return ChannelList(self._parent, self._name, self._chan_type, self._channels[i]) return self._channels[i] def __iter__(self): @@ -162,7 +163,7 @@ def __add__(self, other): if self._parent != other._parent: raise ValueError("Can only add channels from the same parent together.") - return ChannelList(self._parent, self._chan_type, self._channels + other._channels) + return ChannelList(self._parent, self._name, self._chan_type, self._channels + other._channels) def append(self, object): """