source: sasview/sansmodels/src/sans/models/c_models/CCylinderModel.cpp @ 870f131

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 870f131 was 870f131, checked in by Gervaise Alina <gervyh@…>, 15 years ago

change model orientation

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