Beispiel #1
0
    def test_update_raises(self):
        settings = fps.CosmicFish_PlotSettings()
        assert_raises( ValueError, settings.update , 'test' )
        
# ***************************************************************************************

        
Beispiel #2
0
 def test_init(self):
     set = fps.CosmicFish_PlotSettings(do_legend=False)
     test_plotter_1 = fp.CosmicFishPlotter(fishers=self.fisher_list_test,
                                           settings=set)
     assert test_plotter_1.plot_settings.do_legend == False
     test_plotter_2 = fp.CosmicFishPlotter(fishers=self.fisher_list_test,
                                           settings={'do_legend': False})
     assert test_plotter_2.plot_settings.do_legend == False
Beispiel #3
0
        fisher_list = fishers.get_fisher_matrix()
        for fish in fisher_list[1:]:
            fisher_list[0] = fisher_list[0] + fish
        fisher_list[0].name = args.sum_fish
        fishers_temp.add_fisher_matrix(fisher_list[0])
        fishers = fishers_temp

    if args.eliminate:
        if params is None:
            raise ValueError(
                'Avoiding marginalization only works if parameters are specified'
            )
        fishers = fishers.reshuffle(params=params)

    # set up the plot settings
    plot_settings = fps.CosmicFish_PlotSettings()

    # set up the plotter
    plotter = fp.CosmicFishPlotter(settings=plot_settings, fishers=fishers)

    if params is not None:
        params = [list(i) for i in it.combinations(params, 2)]
        if len(params) == 0:
            raise ValueError('Not enough parameters for 2D plot.')

    plotter.new_plot()
    plotter.plot2D(params=params)

    plotter.export(outroot + '.' + output_format)
    plotter.close_plot()
Beispiel #4
0
 def test_update_kwargs(self):
     settings = fps.CosmicFish_PlotSettings()
     settings.update( do_legend=False, D2_show_xaxis_label=False )
     assert settings.do_legend==False
     assert settings.D2_show_xaxis_label == False
Beispiel #5
0
 def test_update_dict(self):
     settings = fps.CosmicFish_PlotSettings()
     settings.update({'do_legend':False})
     assert settings.do_legend==False
Beispiel #6
0
 def test_init_settings_with_kwargs(self):
     settings = fps.CosmicFish_PlotSettings( do_legend=False, D2_show_xaxis_label=False )
     assert settings.do_legend==False
     assert settings.D2_show_xaxis_label == False
Beispiel #7
0
 def test_init_settings_with_dict(self):
     settings = fps.CosmicFish_PlotSettings({'do_legend':False})
     assert settings.do_legend==False
Beispiel #8
0
 def test_init_settings_default(self):
     settings = fps.CosmicFish_PlotSettings()