Example #1
0
 def test_missing_data_idx(self):
     with pytest.raises(InputError):
         model_data = {(): [1, 0.05],
                       3: [2, 0.05],
                       4: [3, 0.05]}
         GaussianLink3D(model_parameters=model_parameters_3D,
                        model_data=model_data)
Example #2
0
 def test_ext_mod_data_list(self):
     data_list = [[(1, 2), [1, 0.05]],
                  [3, [2, 0.05]],
                  [4, [3, 0.05]]]
     modellink_obj = GaussianLink3D(model_parameters=model_parameters_3D,
                                    model_data=data_list)
     repr(modellink_obj)
Example #3
0
 def test_ext_mod_data_dict(self):
     data_dict = {(1, 2): [1, 0.05],
                  3: [2, 0.05],
                  4: [3, 0.05]}
     modellink_obj = GaussianLink3D(model_parameters=model_parameters_3D,
                                    model_data=data_dict)
     repr(modellink_obj)
Example #4
0
 def test_invalid_data_spc(self):
     with pytest.raises(ValueError):
         model_data = {1: [1, 0.05],
                       3: [2, 0.05],
                       4: [3, 0.05, 'A']}
         GaussianLink3D(model_parameters=model_parameters_3D,
                        model_data=model_data)
Example #5
0
def pipe_GUI(tmpdir_factory):
    # Get paths to files
    model_data = path.join(DIR_PATH,
                           '../../tests/data/data_gaussian_single.txt')
    model_parameters_3D = path.join(
        DIR_PATH, '../../tests/data/parameters_gaussian_3D.txt')

    # Create PolyLink object
    modellink_obj = GaussianLink3D(model_parameters=model_parameters_3D,
                                   model_data=model_data)

    # Create Pipeline object
    tmpdir = tmpdir_factory.mktemp('test_GUI')
    root_dir = path.dirname(tmpdir.strpath)
    working_dir = path.basename(tmpdir.strpath)
    prism_dict = {
        'n_sam_init': 150,
        'proj_res': 5,
        'proj_depth': 15,
        'base_eval_sam': 400,
        'l_corr': 0.3,
        'impl_cut': [4.0, 3.5, 3.2],
        'criterion': None,
        'method': 'full',
        'use_regr_cov': False,
        'poly_order': 3,
        'n_cross_val': 5,
        'do_active_anal': True,
        'freeze_active_par': True,
        'pot_active_par': None,
        'use_mock': True
    }
    pipe = Pipeline(modellink_obj,
                    root_dir=root_dir,
                    working_dir=working_dir,
                    prism_par=prism_dict)

    # Construct the first and second iteration of the emulator
    pipe.construct(1)
    pipe.construct(2, analyze=False)

    # Return pipe
    return (pipe)
Example #6
0
 def test_n_model_data(self):
     with pytest.raises(ValueError):
         GaussianLink3D(model_parameters=model_parameters_3D)
Example #7
0
 def test_n_model_par(self):
     with pytest.raises(e13.InputError):
         par_dict = {'A': [1, 5, 2.5]}
         GaussianLink3D(model_parameters=par_dict)
Example #8
0
 def test_data_input_types(self):
     modellink_obj = GaussianLink3D(model_parameters=model_parameters_3D,
                                    model_data=model_data_types)
     repr(modellink_obj)
Example #9
0
 def test_double_errors(self):
     modellink_obj = GaussianLink3D(model_parameters=model_parameters_3D,
                                    model_data=model_data_double)
     repr(modellink_obj)