Ejemplo n.º 1
0
def test_pref_tf_drifting_gratings(new_file,
                                   drifting_gratings,
                                   shape=[500, 500]):
    with oplots.figure_in_px(shape[1], shape[0], new_file) as fig:
        drifting_gratings().plot_preferred_temporal_frequency()
        oplots.finalize_with_axes()
    assert_images_match(new_file, os.path.join(TEST_DATA_DIR, new_file), shape)
Ejemplo n.º 2
0
def test_pref_dir_drifting_gratings(new_file,
                                    drifting_gratings,
                                    shape=[500, 500]):
    with oplots.figure_in_px(shape[1], shape[0], new_file) as fig:
        drifting_gratings().plot_preferred_direction()
        oplots.finalize_no_axes()
    assert_images_match(new_file, os.path.join(TEST_DATA_DIR, new_file), shape)
Ejemplo n.º 3
0
def test_speed_tuning_plot(new_file,
                           analysis,
                           cell_specimen_id,
                           shape=[500, 500]):
    with oplots.figure_in_px(shape[1], shape[0], new_file) as fig:
        analysis().plot_speed_tuning(cell_specimen_id)
        oplots.finalize_with_axes()
    assert_images_match(new_file, os.path.join(TEST_DATA_DIR, new_file), shape)
Ejemplo n.º 4
0
def test_star_plot(new_file,
                   drifting_gratings,
                   cell_specimen_id,
                   shape=[500, 500]):
    with oplots.figure_in_px(shape[1], shape[0], new_file) as fig:
        drifting_gratings().open_star_plot(cell_specimen_id)
        oplots.finalize_no_axes()
    assert_images_match(new_file, os.path.join(TEST_DATA_DIR, new_file), shape)
Ejemplo n.º 5
0
def test_track_plot(new_file,
                    natural_movie,
                    cell_specimen_id,
                    shape=[500, 500]):
    with oplots.figure_in_px(shape[1], shape[0], new_file) as fig:
        natural_movie().open_track_plot(cell_specimen_id)
        oplots.finalize_no_axes()
    assert_images_match(new_file, os.path.join(TEST_DATA_DIR, new_file), shape)
Ejemplo n.º 6
0
def test_pincushion_plot(new_file,
                         locally_sparse_noise,
                         on,
                         cell_specimen_id,
                         shape=[500, 877]):
    with oplots.figure_in_px(shape[1], shape[0], new_file) as fig:
        locally_sparse_noise().open_pincushion_plot(on, cell_specimen_id)
        oplots.finalize_no_axes()
    assert_images_match(new_file, os.path.join(TEST_DATA_DIR, new_file), shape)
def build_plots(prefix, aspect, configs, output_dir, axes=None, transparent=False):
    Manifest.safe_mkdir(output_dir)

    for config in configs:
        h = config['height_px']
        w = int(h * aspect)
        
        file_name = os.path.join(output_dir, config["pattern"] % prefix)

        logging.debug("file: %s", file_name)
        with oplots.figure_in_px(w, h, file_name, transparent=transparent) as fig:
            matplotlib.rcParams.update({'font.size': config['font_size']})
            yield file_name
def test_pincushion_plot(new_file, locally_sparse_noise, on, cell_specimen_id, shape=[500,877]):
    with oplots.figure_in_px(shape[1], shape[0], new_file) as fig:
        locally_sparse_noise().open_pincushion_plot(on, cell_specimen_id)
        oplots.finalize_no_axes()
    assert_images_match(new_file, os.path.join(TEST_DATA_DIR, new_file), shape)
def test_speed_tuning_plot(new_file, analysis, cell_specimen_id, shape=[500,500]):
    with oplots.figure_in_px(shape[1], shape[0], new_file) as fig:
        analysis().plot_speed_tuning(cell_specimen_id)
        oplots.finalize_with_axes()
    assert_images_match(new_file, os.path.join(TEST_DATA_DIR, new_file), shape)
def test_star_plot(new_file, drifting_gratings, cell_specimen_id, shape=[500,500]):
    with oplots.figure_in_px(shape[1], shape[0], new_file) as fig:
        drifting_gratings().open_star_plot(cell_specimen_id)
        oplots.finalize_no_axes()
    assert_images_match(new_file, os.path.join(TEST_DATA_DIR, new_file), shape)
def test_track_plot(new_file, natural_movie, cell_specimen_id, shape=[500,500]):
    with oplots.figure_in_px(shape[1], shape[0], new_file) as fig:
        natural_movie().open_track_plot(cell_specimen_id)
        oplots.finalize_no_axes()
    assert_images_match(new_file, os.path.join(TEST_DATA_DIR, new_file), shape)
def test_ttp_natural_scenes(new_file, natural_scenes, shape=[500,500]):
    with oplots.figure_in_px(shape[1], shape[0], new_file) as fig:
        natural_scenes().plot_time_to_peak()
        oplots.finalize_with_axes()
    assert_images_match(new_file, os.path.join(TEST_DATA_DIR, new_file), shape)
def test_osi_drifting_gratings(new_file, drifting_gratings, shape=[500,500]):
    with oplots.figure_in_px(shape[1], shape[0], new_file) as fig:
        drifting_gratings().plot_orientation_selectivity()
        oplots.finalize_with_axes()
    assert_images_match(new_file, os.path.join(TEST_DATA_DIR, new_file), shape)
def test_pref_tf_drifting_gratings(new_file, drifting_gratings, shape=[500,500]):
    with oplots.figure_in_px(shape[1], shape[0], new_file) as fig:
        drifting_gratings().plot_preferred_temporal_frequency()
        oplots.finalize_with_axes()
    assert_images_match(new_file, os.path.join(TEST_DATA_DIR, new_file), shape)
def test_pref_dir_drifting_gratings(new_file, drifting_gratings, shape=[500,500]):
    with oplots.figure_in_px(shape[1], shape[0], new_file) as fig:
        drifting_gratings().plot_preferred_direction()
        oplots.finalize_no_axes()
    assert_images_match(new_file, os.path.join(TEST_DATA_DIR, new_file), shape)
def test_pref_ori_static_gratings(new_file, static_gratings, shape=[250,500]):
    with oplots.figure_in_px(shape[1], shape[0], new_file) as fig:
        static_gratings().plot_preferred_orientation()
        oplots.finalize_no_axes()
    assert_images_match(new_file, os.path.join(TEST_DATA_DIR, new_file), shape)