本文整理汇总了Python中sparkle.stim.stimulus_model.StimulusModel.columnCountForRow方法的典型用法代码示例。如果您正苦于以下问题:Python StimulusModel.columnCountForRow方法的具体用法?Python StimulusModel.columnCountForRow怎么用?Python StimulusModel.columnCountForRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sparkle.stim.stimulus_model.StimulusModel
的用法示例。
在下文中一共展示了StimulusModel.columnCountForRow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestStimModel
# 需要导入模块: from sparkle.stim.stimulus_model import StimulusModel [as 别名]
# 或者: from sparkle.stim.stimulus_model.StimulusModel import columnCountForRow [as 别名]
class TestStimModel():
def setup(self):
self.model = StimulusModel()
self.model.setReferenceVoltage(100, 0.1)
self.model.setMaxVoltage(MAXV, DEVICE_MAXV)
self.model.setMinVoltage(0.005)
def test_insert_data(self):
fake_component0 = 'ducks'
fake_component1 = 'frogs'
self.model.insertComponent(fake_component0, 0, 0)
self.model.insertComponent(fake_component1, 0, 0)
assert self.model.component(0,0) == fake_component1
assert self.model.component(0,1) == fake_component0
def test_remove_data(self):
fake_component0 = 'ducks'
self.model.insertComponent(fake_component0, 0, 0)
self.model.removeComponent(0,0)
assert self.model.component(0,0) == None
def test_component_index(self):
fake_component0 = 'ducks'
# component will be added to the lowest index in row
self.model.insertComponent(fake_component0, 0, 2)
index = self.model.indexByComponent(fake_component0)
assert index == (0,0)
@raises(IndexError)
def test_set_data(self):
fake_component0 = 'ducks'
self.model.overwriteComponent(fake_component0, 0, 0)
def test_row_column_count(self):
fake_component0 = 'ducks'
self.model.insertComponent(fake_component0, 0, 0)
assert self.model.columnCountForRow(0) == 1
assert self.model.rowCount() == 1
def test_trace_count_no_auto(self):
component0 = PureTone()
component1 = PureTone()
self.model.insertComponent(component0, 0,0)
self.model.insertComponent(component1, 0,0)
assert self.model.traceCount() == 1
def test_trace_count_no_components(self):
self.add_auto_param(self.model)
assert self.model.traceCount() == 0
def test_trace_count_with_auto(self):
component = PureTone()
self.model.insertComponent(component, 0,0)
nsteps = self.add_auto_param(self.model)
assert self.model.traceCount() == nsteps
def test_model_contains(self):
component = PureTone()
self.model.insertComponent(component, 0,0)
assert self.model.contains('PureTone')
def test_expanded_stim_no_auto(self):
"""signal of a model without any auto parameters"""
component = PureTone()
self.model.insertComponent(component, 0,0)
signals, doc, ovld = self.model.expandedStim()
assert len(signals) == 1
assert_equal(signals[0][0].shape[0], component.duration()*self.model.samplerate())
assert len(doc) == 1
assert doc[0]['samplerate_da'] == self.model.samplerate()
def test_expanded_stim_with_auto(self):
component = PureTone()
self.model.insertComponent(component, 0,0)
nsteps = self.add_auto_param(self.model)
signals, doc, ovld = self.model.expandedStim()
assert len(signals) == nsteps
assert len(doc) == nsteps
assert doc[0]['samplerate_da'] == self.model.samplerate()
def test_expaned_stim_with_vocal_auto(self):
component = Vocalization()
component.setFile(sample.samplewav())
self.model.insertComponent(component, 0,0)
nsteps = self.add_vocal_param(self.model)
signals, doc, ovld = self.model.expandedStim()
assert len(signals) == nsteps
assert len(doc) == nsteps
assert doc[0]['samplerate_da'] == self.model.samplerate()
def test_signal_eq_caldb(self):
caldb = 100
#.........这里部分代码省略.........