MCPcopy Create free account
hub / github.com/PyTTaMaster/PyTTa / __truediv__

Method __truediv__

pytta/classes/_base.py:675–700  ·  view source on GitHub ↗
(self, otherList)

Source from the content-addressed store, hash-verified

673 return newChList
674
675 def __truediv__(self, otherList):
676 if not isinstance(otherList, ChannelsList):
677 raise TypeError('Can\'t "divide" by other \
678 type than a ChannelsList')
679 if len(self) > 1:
680 if len(otherList) > 1:
681 if len(self) != len(otherList):
682 raise ValueError("Both ChannelsList-like objects must \
683 have the same number of channels.")
684
685 newChList = ChannelsList([self[self.mapping[idx]]/
686 otherList[otherList.mapping[idx]]
687 for idx in range(len(self))])
688 else:
689 newChList = ChannelsList([self[self.mapping[idx]]/
690 otherList[otherList.mapping[0]]
691 for idx in range(len(self))])
692 else:
693 if len(otherList) > 1:
694 newChList = ChannelsList([self[self.mapping[0]]/
695 otherList[otherList.mapping[idx]]
696 for idx in range(len(otherList))])
697 else:
698 newChList = ChannelsList([self._channels[0] /
699 otherList._channels[0]])
700 return newChList
701
702 def __contains__(self, chRef):
703 if isinstance(chRef, str):

Callers

nothing calls this directly

Calls 1

ChannelsListClass · 0.85

Tested by

no test coverage detected