Пример #1
0
 def test_boar_reduced(self):
     data = load_stimuli('naturalistic-neural-reduced.Boar')
     assert len(data) == 47
     assert data[0] == 'If you were to journey to the North of England you would ' \
                       'come to a valley that is surrounded by moors as high as'
     assert data[-1] == "His fame was indeed assured but it was not nearly as lasting " \
                        "as that of the fearsome Bradford Boar."
Пример #2
0
 def test_1(self):
     data = load_stimuli('diverse.1')
     assert len(data) == 384
     assert data[
         0] == 'An accordion is a portable musical instrument with two keyboards.'
     assert data[
         -1] == 'A woman has different reproductive organs than a man.'
Пример #3
0
 def test_2(self):
     data = load_stimuli('diverse.2')
     assert len(data) == 243
     assert data[
         0] == 'Beekeeping encourages the conservation of local habitats.'
     assert data[
         -1] == "This has led to more injuries, particularly to ligaments in the skier's knee."
Пример #4
0
 def _test_load_all(self, reduced=False):
     for story in [
             'Boar', 'MatchstickSeller', 'KingOfBirds', 'Elvis',
             'HighSchool'
     ]:
         data = load_stimuli('naturalistic-neural-{}.{}'.format(
             'reduced' if reduced else 'full', story))
         assert data is not None
         assert len(data) > 0
Пример #5
0
 def test_boar_full(self):
     data = load_stimuli('naturalistic-neural-full.Boar')
     assert len(data) == 23
     assert data[0] == 'That all mill owners were generally busy as beavers and quite pleased with themselves for ' \
                       'being so successful and well off was known to the residents of Bradford and if you were to ' \
                       'go into the city to visit the stately City Hall you would see there the Crest of the City ' \
                       'of Bradford which those same mill owners created to celebrate their achievements.'
     assert data[-1] == "His fame was indeed assured but it was not nearly as lasting " \
                        "as that of the fearsome Bradford Boar."
Пример #6
0
 def _load_rdms(self, roi_filter='from90to100', bold_shift_seconds=4):
     assemblies = {}
     for story in ['Boar', 'KingOfBirds', 'Elvis', 'HighSchool', 'MatchstickSeller']:
         assembly = load_rdm_sentences(story=story, roi_filter=roi_filter, bold_shift_seconds=bold_shift_seconds)
         assembly = assembly.mean(dim='subject')
         stimulus_set_identifier = f'naturalistic-neural-reduced.{story}'
         stimulus_set = load_stimuli(stimulus_set_identifier)
         stimulus_set = StimulusSet({'sentence': stimulus_set})
         stimulus_set.name = stimulus_set_identifier
         assembly.attrs['stimulus_set'] = stimulus_set
         assemblies[story] = assembly
     return assemblies