Changeset 1b758b3 in sasview for sansmodels/src/python_wrapper
- Timestamp:
- Jan 6, 2012 12:15:18 PM (13 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- ee0f3fc
- Parents:
- 886dde6b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/python_wrapper/WrapperGenerator.py
r101065a r1b758b3 323 323 (par, self.params[par]) 324 324 325 param_str += " // Initialize dispersion / averaging parameter dict\n" 326 param_str += " DispersionVisitor* visitor = new DispersionVisitor();\n" 327 param_str += " PyObject * disp_dict;\n" 328 for par in self.disp_params: 329 par = par.strip() 330 param_str += " disp_dict = PyDict_New();\n" 331 param_str += " self->model->%s.dispersion->accept_as_source(visitor, self->model->%s.dispersion, disp_dict);\n" % (par, par) 332 param_str += " PyDict_SetItemString(self->dispersion, \"%s\", disp_dict);\n" % par 325 if len(self.disp_params)>0: 326 param_str += " // Initialize dispersion / averaging parameter dict\n" 327 param_str += " DispersionVisitor* visitor = new DispersionVisitor();\n" 328 param_str += " PyObject * disp_dict;\n" 329 for par in self.disp_params: 330 par = par.strip() 331 param_str += " disp_dict = PyDict_New();\n" 332 param_str += " self->model->%s.dispersion->accept_as_source(visitor, self->model->%s.dispersion, disp_dict);\n" % (par, par) 333 param_str += " PyDict_SetItemString(self->dispersion, \"%s\", disp_dict);\n" % par 333 334 334 335 # Initialize dispersion object dictionnary … … 345 346 (par, par) 346 347 347 param_str += " // Read in dispersion parameters\n" 348 param_str += " PyObject* disp_dict;\n" 349 param_str += " DispersionVisitor* visitor = new DispersionVisitor();\n" 350 for par in self.disp_params: 351 par = par.strip() 352 param_str += " disp_dict = PyDict_GetItemString(self->dispersion, \"%s\");\n" % par 353 param_str += " self->model->%s.dispersion->accept_as_destination(visitor, self->model->%s.dispersion, disp_dict);\n" % (par, par) 348 if len(self.disp_params)>0: 349 param_str += " // Read in dispersion parameters\n" 350 param_str += " PyObject* disp_dict;\n" 351 param_str += " DispersionVisitor* visitor = new DispersionVisitor();\n" 352 for par in self.disp_params: 353 par = par.strip() 354 param_str += " disp_dict = PyDict_GetItemString(self->dispersion, \"%s\");\n" % par 355 param_str += " self->model->%s.dispersion->accept_as_destination(visitor, self->model->%s.dispersion, disp_dict);\n" % (par, par) 354 356 355 357 newline = self.replaceToken(newline, "[READDICTIONARY]", param_str)
Note: See TracChangeset
for help on using the changeset viewer.