source: sasview/src/sans/models/c_extension/python_wrapper/generated/CDABModel.cpp @ 400155b

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 400155b was 400155b, checked in by gonzalezm, 9 years ago

Implementing request from ticket 261 - default number of bins in Annulus [Phi View] is now 36 and the first bin is now centered at 0 degrees

  • Property mode set to 100644
File size: 20.8 KB
Line 
1/**
2        This software was developed by the University of Tennessee as part of the
3        Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
4        project funded by the US National Science Foundation.
5
6        If you use DANSE applications to do scientific research that leads to
7        publication, we ask that you acknowledge the use of the software with the
8        following sentence:
9
10        "This work benefited from DANSE software developed under NSF award DMR-0520547."
11
12        copyright 2008, University of Tennessee
13 */
14
15/** CDABModel
16 *
17 * C extension
18 *
19 * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
20 *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\dabmodel.h
21 *          AND RE-RUN THE GENERATOR SCRIPT
22 *
23 */
24#define NO_IMPORT_ARRAY
25#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
26 
27extern "C" {
28#include <Python.h>
29#include <arrayobject.h>
30#include "structmember.h"
31#include <stdio.h>
32#include <stdlib.h>
33#include <math.h>
34#include <time.h>
35
36}
37
38#include "dabmodel.h"
39#include "dispersion_visitor.hh"
40
41/// Error object for raised exceptions
42static PyObject * CDABModelError = NULL;
43
44
45// Class definition
46typedef struct {
47    PyObject_HEAD
48    /// Parameters
49    PyObject * params;
50    /// Dispersion parameters
51    PyObject * dispersion;
52    /// Underlying model object
53    DABModel * model;
54    /// Log for unit testing
55    PyObject * log;
56} CDABModel;
57
58
59static void
60CDABModel_dealloc(CDABModel* self)
61{
62    Py_DECREF(self->params);
63    Py_DECREF(self->dispersion);
64    Py_DECREF(self->log);
65    delete self->model;
66    self->ob_type->tp_free((PyObject*)self);
67   
68
69}
70
71static PyObject *
72CDABModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
73{
74    CDABModel *self;
75   
76    self = (CDABModel *)type->tp_alloc(type, 0);
77   
78    return (PyObject *)self;
79}
80
81static int
82CDABModel_init(CDABModel *self, PyObject *args, PyObject *kwds)
83{
84    if (self != NULL) {
85       
86        // Create parameters
87        self->params = PyDict_New();
88        self->dispersion = PyDict_New();
89
90        self->model = new DABModel();
91
92        // Initialize parameter dictionary
93        PyDict_SetItemString(self->params,"length",Py_BuildValue("d",50.000000000000));
94        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
95        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
96        // Initialize dispersion / averaging parameter dict
97        DispersionVisitor* visitor = new DispersionVisitor();
98        PyObject * disp_dict;
99        disp_dict = PyDict_New();
100        self->model->length.dispersion->accept_as_source(visitor, self->model->length.dispersion, disp_dict);
101        PyDict_SetItemString(self->dispersion, "length", disp_dict);
102        disp_dict = PyDict_New();
103        self->model->scale.dispersion->accept_as_source(visitor, self->model->scale.dispersion, disp_dict);
104        PyDict_SetItemString(self->dispersion, "scale", disp_dict);
105        disp_dict = PyDict_New();
106        self->model->background.dispersion->accept_as_source(visitor, self->model->background.dispersion, disp_dict);
107        PyDict_SetItemString(self->dispersion, "background", disp_dict);
108
109
110         
111        // Create empty log
112        self->log = PyDict_New();
113       
114       
115
116    }
117    return 0;
118}
119
120static char name_params[] = "params";
121static char def_params[] = "Parameters";
122static char name_dispersion[] = "dispersion";
123static char def_dispersion[] = "Dispersion parameters";
124static char name_log[] = "log";
125static char def_log[] = "Log";
126
127static PyMemberDef CDABModel_members[] = {
128    {name_params, T_OBJECT, offsetof(CDABModel, params), 0, def_params},
129        {name_dispersion, T_OBJECT, offsetof(CDABModel, dispersion), 0, def_dispersion},     
130    {name_log, T_OBJECT, offsetof(CDABModel, log), 0, def_log},
131    {NULL}  /* Sentinel */
132};
133
134/** Read double from PyObject
135    @param p PyObject
136    @return double
137*/
138double CDABModel_readDouble(PyObject *p) {
139    if (PyFloat_Check(p)==1) {
140        return (double)(((PyFloatObject *)(p))->ob_fval);
141    } else if (PyInt_Check(p)==1) {
142        return (double)(((PyIntObject *)(p))->ob_ival);
143    } else if (PyLong_Check(p)==1) {
144        return (double)PyLong_AsLong(p);
145    } else {
146        return 0.0;
147    }
148}
149/**
150 * Function to call to evaluate model
151 * @param args: input numpy array q[]
152 * @return: numpy array object
153 */
154 
155static PyObject *evaluateOneDim(DABModel* model, PyArrayObject *q){
156    PyArrayObject *result;
157   
158    // Check validity of array q , q must be of dimension 1, an array of double
159    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
160    {
161        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
162        //PyErr_SetString(PyExc_ValueError , message);
163        return NULL;
164    }
165    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
166        if (result == NULL) {
167        const char * message= "Could not create result ";
168        PyErr_SetString(PyExc_RuntimeError , message);
169                return NULL;
170        }
171#pragma omp parallel for
172         for (int i = 0; i < q->dimensions[0]; i++){
173      double q_value  = *(double *)(q->data + i*q->strides[0]);
174      double *result_value = (double *)(result->data + i*result->strides[0]);
175      *result_value =(*model)(q_value);
176        }
177    return PyArray_Return(result); 
178 }
179
180 /**
181 * Function to call to evaluate model
182 * @param args: input numpy array  [x[],y[]]
183 * @return: numpy array object
184 */
185 static PyObject * evaluateTwoDimXY( DABModel* model, 
186                              PyArrayObject *x, PyArrayObject *y)
187 {
188    PyArrayObject *result;
189    int x_len, y_len, dims[1];
190    //check validity of input vectors
191    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
192        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
193        || y->dimensions[0] != x->dimensions[0]){
194        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
195        PyErr_SetString(PyExc_ValueError , message); 
196        return NULL;
197    }
198   
199        if (PyArray_Check(x) && PyArray_Check(y)) {
200               
201            x_len = dims[0]= x->dimensions[0];
202        y_len = dims[0]= y->dimensions[0];
203           
204            // Make a new double matrix of same dims
205        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
206        if (result == NULL){
207            const char * message= "Could not create result ";
208        PyErr_SetString(PyExc_RuntimeError , message);
209            return NULL;
210            }
211       
212        /* Do the calculation. */
213#pragma omp parallel for
214        for (int i=0; i< x_len; i++) {
215            double x_value = *(double *)(x->data + i*x->strides[0]);
216                    double y_value = *(double *)(y->data + i*y->strides[0]);
217                        double *result_value = (double *)(result->data +
218                              i*result->strides[0]);
219                        *result_value = (*model)(x_value, y_value);
220        }           
221        return PyArray_Return(result); 
222       
223        }else{
224                    PyErr_SetString(CDABModelError, 
225                   "CDABModel.evaluateTwoDimXY couldn't run.");
226                return NULL;
227                }       
228}
229/**
230 *  evalDistribution function evaluate a model function with input vector
231 *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
232 *
233 */ 
234static PyObject * evalDistribution(CDABModel *self, PyObject *args){
235        PyObject *qx, *qy;
236        PyArrayObject * pars;
237        int npars ,mpars;
238       
239        // Get parameters
240       
241            // Reader parameter dictionary
242    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
243    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
244    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
245    // Read in dispersion parameters
246    PyObject* disp_dict;
247    DispersionVisitor* visitor = new DispersionVisitor();
248    disp_dict = PyDict_GetItemString(self->dispersion, "length");
249    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
250    disp_dict = PyDict_GetItemString(self->dispersion, "scale");
251    self->model->scale.dispersion->accept_as_destination(visitor, self->model->scale.dispersion, disp_dict);
252    disp_dict = PyDict_GetItemString(self->dispersion, "background");
253    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
254
255       
256        // Get input and determine whether we have to supply a 1D or 2D return value.
257        if ( !PyArg_ParseTuple(args,"O",&pars) ) {
258            PyErr_SetString(CDABModelError, 
259                "CDABModel.evalDistribution expects a q value.");
260                return NULL;
261        }
262    // Check params
263       
264    if(PyArray_Check(pars)==1) {
265               
266            // Length of list should 1 or 2
267            npars = pars->nd; 
268            if(npars==1) {
269                // input is a numpy array
270                if (PyArray_Check(pars)) {
271                        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
272                    }
273                }else{
274                    PyErr_SetString(CDABModelError, 
275                   "CDABModel.evalDistribution expect numpy array of one dimension.");
276                return NULL;
277                }
278    }else if( PyList_Check(pars)==1) {
279        // Length of list should be 2 for I(qx,qy)
280            mpars = PyList_GET_SIZE(pars); 
281            if(mpars!=2) {
282                PyErr_SetString(CDABModelError, 
283                        "CDABModel.evalDistribution expects a list of dimension 2.");
284                return NULL;
285            }
286             qx = PyList_GET_ITEM(pars,0);
287             qy = PyList_GET_ITEM(pars,1);
288             if (PyArray_Check(qx) && PyArray_Check(qy)) {
289                 return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
290                           (PyArrayObject*)qy);
291                 }else{
292                    PyErr_SetString(CDABModelError, 
293                   "CDABModel.evalDistribution expect 2 numpy arrays in list.");
294                return NULL;
295             }
296        }
297        PyErr_SetString(CDABModelError, 
298                   "CDABModel.evalDistribution couln't be run.");
299        return NULL;
300       
301}
302
303/**
304 * Function to call to evaluate model
305 * @param args: input q or [q,phi]
306 * @return: function value
307 */
308static PyObject * run(CDABModel *self, PyObject *args) {
309        double q_value, phi_value;
310        PyObject* pars;
311        int npars;
312       
313        // Get parameters
314       
315            // Reader parameter dictionary
316    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
317    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
318    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
319    // Read in dispersion parameters
320    PyObject* disp_dict;
321    DispersionVisitor* visitor = new DispersionVisitor();
322    disp_dict = PyDict_GetItemString(self->dispersion, "length");
323    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
324    disp_dict = PyDict_GetItemString(self->dispersion, "scale");
325    self->model->scale.dispersion->accept_as_destination(visitor, self->model->scale.dispersion, disp_dict);
326    disp_dict = PyDict_GetItemString(self->dispersion, "background");
327    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
328
329       
330        // Get input and determine whether we have to supply a 1D or 2D return value.
331        if ( !PyArg_ParseTuple(args,"O",&pars) ) {
332            PyErr_SetString(CDABModelError, 
333                "CDABModel.run expects a q value.");
334                return NULL;
335        }
336         
337        // Check params
338        if( PyList_Check(pars)==1) {
339               
340                // Length of list should be 2 for I(q,phi)
341            npars = PyList_GET_SIZE(pars); 
342            if(npars!=2) {
343                PyErr_SetString(CDABModelError, 
344                        "CDABModel.run expects a double or a list of dimension 2.");
345                return NULL;
346            }
347            // We have a vector q, get the q and phi values at which
348            // to evaluate I(q,phi)
349            q_value = CDABModel_readDouble(PyList_GET_ITEM(pars,0));
350            phi_value = CDABModel_readDouble(PyList_GET_ITEM(pars,1));
351            // Skip zero
352            if (q_value==0) {
353                return Py_BuildValue("d",0.0);
354            }
355                return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
356
357        } else {
358
359                // We have a scalar q, we will evaluate I(q)
360                q_value = CDABModel_readDouble(pars);           
361               
362                return Py_BuildValue("d",(*(self->model))(q_value));
363        }       
364}
365/**
366 * Function to call to calculate_ER
367 * @return: effective radius value
368 */
369static PyObject * calculate_ER(CDABModel *self) {
370
371        // Get parameters
372       
373            // Reader parameter dictionary
374    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
375    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
376    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
377    // Read in dispersion parameters
378    PyObject* disp_dict;
379    DispersionVisitor* visitor = new DispersionVisitor();
380    disp_dict = PyDict_GetItemString(self->dispersion, "length");
381    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
382    disp_dict = PyDict_GetItemString(self->dispersion, "scale");
383    self->model->scale.dispersion->accept_as_destination(visitor, self->model->scale.dispersion, disp_dict);
384    disp_dict = PyDict_GetItemString(self->dispersion, "background");
385    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
386
387               
388        return Py_BuildValue("d",(*(self->model)).calculate_ER());
389
390}
391/**
392 * Function to call to cal the ratio shell volume/ total volume
393 * @return: the ratio shell volume/ total volume
394 */
395static PyObject * calculate_VR(CDABModel *self) {
396
397        // Get parameters
398       
399            // Reader parameter dictionary
400    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
401    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
402    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
403    // Read in dispersion parameters
404    PyObject* disp_dict;
405    DispersionVisitor* visitor = new DispersionVisitor();
406    disp_dict = PyDict_GetItemString(self->dispersion, "length");
407    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
408    disp_dict = PyDict_GetItemString(self->dispersion, "scale");
409    self->model->scale.dispersion->accept_as_destination(visitor, self->model->scale.dispersion, disp_dict);
410    disp_dict = PyDict_GetItemString(self->dispersion, "background");
411    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
412
413               
414        return Py_BuildValue("d",(*(self->model)).calculate_VR());
415
416}
417/**
418 * Function to call to evaluate model in cartesian coordinates
419 * @param args: input q or [qx, qy]]
420 * @return: function value
421 */
422static PyObject * runXY(CDABModel *self, PyObject *args) {
423        double qx_value, qy_value;
424        PyObject* pars;
425        int npars;
426       
427        // Get parameters
428       
429            // Reader parameter dictionary
430    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
431    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
432    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
433    // Read in dispersion parameters
434    PyObject* disp_dict;
435    DispersionVisitor* visitor = new DispersionVisitor();
436    disp_dict = PyDict_GetItemString(self->dispersion, "length");
437    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
438    disp_dict = PyDict_GetItemString(self->dispersion, "scale");
439    self->model->scale.dispersion->accept_as_destination(visitor, self->model->scale.dispersion, disp_dict);
440    disp_dict = PyDict_GetItemString(self->dispersion, "background");
441    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
442
443       
444        // Get input and determine whether we have to supply a 1D or 2D return value.
445        if ( !PyArg_ParseTuple(args,"O",&pars) ) {
446            PyErr_SetString(CDABModelError, 
447                "CDABModel.run expects a q value.");
448                return NULL;
449        }
450         
451        // Check params
452        if( PyList_Check(pars)==1) {
453               
454                // Length of list should be 2 for I(qx, qy))
455            npars = PyList_GET_SIZE(pars); 
456            if(npars!=2) {
457                PyErr_SetString(CDABModelError, 
458                        "CDABModel.run expects a double or a list of dimension 2.");
459                return NULL;
460            }
461            // We have a vector q, get the qx and qy values at which
462            // to evaluate I(qx,qy)
463            qx_value = CDABModel_readDouble(PyList_GET_ITEM(pars,0));
464            qy_value = CDABModel_readDouble(PyList_GET_ITEM(pars,1));
465            return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
466
467        } else {
468
469                // We have a scalar q, we will evaluate I(q)
470                qx_value = CDABModel_readDouble(pars);         
471               
472                return Py_BuildValue("d",(*(self->model))(qx_value));
473        }       
474}
475
476static PyObject * reset(CDABModel *self, PyObject *args) {
477   
478
479    return Py_BuildValue("d",0.0);
480}
481
482static PyObject * set_dispersion(CDABModel *self, PyObject *args) {
483        PyObject * disp;
484        const char * par_name;
485
486        if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
487            PyErr_SetString(CDABModelError,
488                "CDABModel.set_dispersion expects a DispersionModel object.");
489                return NULL;
490        }
491        void *temp = PyCObject_AsVoidPtr(disp);
492        DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
493
494
495        // Ugliness necessary to go from python to C
496            // TODO: refactor this
497    if (!strcmp(par_name, "length")) {
498        self->model->length.dispersion = dispersion;
499    } else    if (!strcmp(par_name, "scale")) {
500        self->model->scale.dispersion = dispersion;
501    } else    if (!strcmp(par_name, "background")) {
502        self->model->background.dispersion = dispersion;
503    } else {
504            PyErr_SetString(CDABModelError,
505                "CDABModel.set_dispersion expects a valid parameter name.");
506                return NULL;
507        }
508
509        DispersionVisitor* visitor = new DispersionVisitor();
510        PyObject * disp_dict = PyDict_New();
511        dispersion->accept_as_source(visitor, dispersion, disp_dict);
512        PyDict_SetItemString(self->dispersion, par_name, disp_dict);
513    return Py_BuildValue("i",1);
514}
515
516
517static PyMethodDef CDABModel_methods[] = {
518    {"run",      (PyCFunction)run     , METH_VARARGS,
519      "Evaluate the model at a given Q or Q, phi"},
520    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
521      "Evaluate the model at a given Q or Qx, Qy"},
522    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
523      "Evaluate the model at a given Q or Q, phi"},
524    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
525      "Evaluate VR"},   
526    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
527      "Evaluate the model at a given Q or Qx, Qy vector "},
528    {"reset",    (PyCFunction)reset   , METH_VARARGS,
529      "Reset pair correlation"},
530    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
531      "Set the dispersion model for a given parameter"},
532   {NULL}
533};
534
535static PyTypeObject CDABModelType = {
536    PyObject_HEAD_INIT(NULL)
537    0,                         /*ob_size*/
538    "CDABModel",             /*tp_name*/
539    sizeof(CDABModel),             /*tp_basicsize*/
540    0,                         /*tp_itemsize*/
541    (destructor)CDABModel_dealloc, /*tp_dealloc*/
542    0,                         /*tp_print*/
543    0,                         /*tp_getattr*/
544    0,                         /*tp_setattr*/
545    0,                         /*tp_compare*/
546    0,                         /*tp_repr*/
547    0,                         /*tp_as_number*/
548    0,                         /*tp_as_sequence*/
549    0,                         /*tp_as_mapping*/
550    0,                         /*tp_hash */
551    0,                         /*tp_call*/
552    0,                         /*tp_str*/
553    0,                         /*tp_getattro*/
554    0,                         /*tp_setattro*/
555    0,                         /*tp_as_buffer*/
556    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
557    "CDABModel objects",           /* tp_doc */
558    0,                         /* tp_traverse */
559    0,                         /* tp_clear */
560    0,                         /* tp_richcompare */
561    0,                         /* tp_weaklistoffset */
562    0,                         /* tp_iter */
563    0,                         /* tp_iternext */
564    CDABModel_methods,             /* tp_methods */
565    CDABModel_members,             /* tp_members */
566    0,                         /* tp_getset */
567    0,                         /* tp_base */
568    0,                         /* tp_dict */
569    0,                         /* tp_descr_get */
570    0,                         /* tp_descr_set */
571    0,                         /* tp_dictoffset */
572    (initproc)CDABModel_init,      /* tp_init */
573    0,                         /* tp_alloc */
574    CDABModel_new,                 /* tp_new */
575};
576
577
578//static PyMethodDef module_methods[] = {
579//    {NULL}
580//};
581
582/**
583 * Function used to add the model class to a module
584 * @param module: module to add the class to
585 */ 
586void addCDABModel(PyObject *module) {
587        PyObject *d;
588       
589    if (PyType_Ready(&CDABModelType) < 0)
590        return;
591
592    Py_INCREF(&CDABModelType);
593    PyModule_AddObject(module, "CDABModel", (PyObject *)&CDABModelType);
594   
595    d = PyModule_GetDict(module);
596    static char error_name[] = "CDABModel.error";
597    CDABModelError = PyErr_NewException(error_name, NULL, NULL);
598    PyDict_SetItemString(d, "CDABModelError", CDABModelError);
599}
600
Note: See TracBrowser for help on using the repository browser.