From d9e10235030370ec57db961c28d7d7191d534711 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 19 Apr 2011 13:11:31 -0400 Subject: [PATCH] Add a method for extracting input channels by name. --- pypiezo/base.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pypiezo/base.py b/pypiezo/base.py index 4cffdba..b80d727 100644 --- a/pypiezo/base.py +++ b/pypiezo/base.py @@ -455,6 +455,13 @@ class Piezo (object): return axis raise ValueError(name) + def input_channel_by_name(self, name): + "Get an input channel by its name." + for input_channel in self.input_channels: + if input_channel.name == name: + return input_channel + raise ValueError(name) + def channels(self, direction=None): """Iterate through all `(name, channel)` tuples. -- 2.26.2