source: sasview/sansmodels/src/sans/models/c_models/CLamellarPSModel.cpp @ 7e99f5c

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

change destructor for models

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