dora/server/server.py
def initialise_sampler():
    """ Initialise the Sampler Model
    This expects a dict containing:
        lower : a list of the lower bounds of the region of interest
        upper : a list of the upper bounds of the region of interest

        Optional dict entries for the model initialisation:
            kerneldef : Kernel function definition. See the 'gp' module.
            n_train : int
                Number of training samples required before sampler can be
                trained
            acq_name : str
                A string specifying the type of acquisition function used
            explore_priority : float, optional
                The priority of exploration against exploitation
    """
    initDict = fl.request.json


    if not hasattr(fl.current_app, 'samplers'):
        fl.current_app.samplers = {}

    samplerid = len(fl.current_app.samplers)

    fl.current_app.samplers[samplerid] \
        = GPsampler(initDict['lower'], initDict['upper'], acq_name=initDict['acq_name'],
                    n_train= initDict['n_train'])

    obs_uri = fl.url_for('.get_query', samplerid=samplerid, _external=True)
    pred_uri = fl.url_for('.predict', samplerid=samplerid, _external=True)
    training_uri = fl.url_for('.retrieve_trainingdata', samplerid=samplerid,
                              _external=True)
    settings_uri = fl.url_for('.retrieve_settings', samplerid=samplerid,
                              _external=True)

    response_data = {"status": "OK", "samplerid": samplerid, 'obs_uri':
                     obs_uri, 'pred_uri': pred_uri, 'training_data_uri':
                     training_uri, 'settings': settings_uri}

    return response_data, 200
 Initialise the Sampler Model
    This expects a dict containing:
        lower : a list of the lower bounds of the region of interest
        upper : a list of the upper bounds of the region of interest

        Optional dict entries for the model initialisation:
            kerneldef : Kernel function definition. See the 'gp' module.
            n_train : int
                Number of training samples required before sampler can be
                trained
            acq_name : str
                A string specifying the type of acquisition function used
            explore_priority : float, optional
                The priority of exploration against exploitation
    
Initialise the Sampler Model
This expects a dict containing:
lower : a list of the lower bounds of the region of interest
upper : a list of the upper bounds of the region of interest

Optional dict entries for the model initialisation:
kerneldef : Kernel function definition. See the 'gp' module.
n_train : int
Number of training samples required before sampler can be
trained
acq_name : str
A string specifying the type of acquisition function used
explore_priority : float, optional
The priority of exploration against exploitation
Initialise the Sampler Model This expects a dict containing : lower : a list of the lower bounds of the region of interest upper : a list of the upper bounds of the region of interest Optional dict entries for the model initialisation : kerneldef : Kernel function definition . See the ' gp ' module . n_train : int Number of training samples required before sampler can be trained acq_name : str A string specifying the type of acquisition function used explore_priority : float optional The priority of exploration against exploitation
def initialise_sampler():
    initDict = fl.request.json
    if not hasattr(fl.current_app, 'samplers'):
        fl.current_app.samplers = {}
    samplerid = len(fl.current_app.samplers)
    fl.current_app.samplers[samplerid] \
        = GPsampler(initDict['lower'], initDict['upper'], acq_name=initDict['acq_name'],
                    n_train= initDict['n_train'])
    obs_uri = fl.url_for('.get_query', samplerid=samplerid, _external=True)
    pred_uri = fl.url_for('.predict', samplerid=samplerid, _external=True)
    training_uri = fl.url_for('.retrieve_trainingdata', samplerid=samplerid,
                              _external=True)
    settings_uri = fl.url_for('.retrieve_settings', samplerid=samplerid,
                              _external=True)
    response_data = {"status": "OK", "samplerid": samplerid, 'obs_uri':
                     obs_uri, 'pred_uri': pred_uri, 'training_data_uri':
                     training_uri, 'settings': settings_uri}
    return response_data, 200
def initialise_sampler ( ) : initDict = fl . request . json if not hasattr ( fl . current_app , 'samplers' ) : fl . current_app . samplers = { } samplerid = len ( fl . current_app . samplers ) fl . current_app . samplers [ samplerid ] = GPsampler ( initDict [ 'lower' ] , initDict [ 'upper' ] , acq_name = initDict [ 'acq_name' ] , n_train = initDict [ 'n_train' ] ) obs_uri = fl . url_for ( '.get_query' , samplerid = samplerid , _external = True ) pred_uri = fl . url_for ( '.predict' , samplerid = samplerid , _external = True ) training_uri = fl . url_for ( '.retrieve_trainingdata' , samplerid = samplerid , _external = True ) settings_uri = fl . url_for ( '.retrieve_settings' , samplerid = samplerid , _external = True ) response_data = { "status" : "OK" , "samplerid" : samplerid , 'obs_uri' : obs_uri , 'pred_uri' : pred_uri , 'training_data_uri' : training_uri , 'settings' : settings_uri } return response_data , 200
Initialise the Sampler Model
This expects a dict containing:
lower : a list of the lower bounds of the region of interest
upper : a list of the upper bounds of the region of interest
Initialise the Sampler Model This expects a dict containing : lower : a list of the lower bounds of the region of interest upper : a list of the upper bounds of the region of interest
""" Initialise the Sampler Model
    This expects a dict containing:
        lower : a list of the lower bounds of the region of interest
        upper : a list of the upper bounds of the region of interest

        Optional dict entries for the model initialisation:
            kerneldef : Kernel function definition. See the 'gp' module.
            n_train : int
                Number of training samples required before sampler can be
                trained
            acq_name : str
                A string specifying the type of acquisition function used
            explore_priority : float, optional
                The priority of exploration against exploitation
    """