Ignore:
Timestamp:
Nov 22, 2011 4:18:22 PM (13 years ago)
Author:
Mathieu Doucet <doucetm@…>
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:
641166b
Parents:
d404f19
Message:

Re #5 Fix p(r) unit tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pr_inversion/src/sans/pr/c_extensions/Cinvertor.c

    rc04cbd7 r007f9b3  
    700700        if (!PyArg_ParseTuple(args, "OOd", &data_obj, &err_obj, &r)) return NULL; 
    701701        OUTVECTOR(data_obj,pars,npars); 
    702         OUTVECTOR(err_obj,pars_err,npars2); 
    703  
    704         pr_err(pars, pars_err, self->params.d_max, npars, r, &pr_value, &pr_err_value); 
     702 
     703        if (err_obj == Py_None) { 
     704                pr_value = pr(pars, self->params.d_max, npars, r); 
     705                pr_err_value = 0.0; 
     706        } else { 
     707                OUTVECTOR(err_obj,pars_err,npars2); 
     708                pr_err(pars, pars_err, self->params.d_max, npars, r, &pr_value, &pr_err_value); 
     709        } 
    705710        return Py_BuildValue("ff", pr_value, pr_err_value); 
    706711} 
Note: See TracChangeset for help on using the changeset viewer.