Changeset e44432d in sasmodels for sasmodels/kerneldll.py


Ignore:
Timestamp:
Oct 19, 2018 5:46:26 PM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
be43e39
Parents:
2586ab72
Message:

support hollow models in structure factor calculations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kerneldll.py

    r6e7ba14 re44432d  
    9999    pass 
    100100# pylint: enable=unused-import 
     101 
     102# Compiler output is a byte stream that needs to be decode in python 3 
     103decode = (lambda s: s) if sys.version_info[0] < 3 else (lambda s: s.decode('utf8')) 
    101104 
    102105if "SAS_DLL_PATH" in os.environ: 
     
    184187        subprocess.check_output(command, shell=shell, stderr=subprocess.STDOUT) 
    185188    except subprocess.CalledProcessError as exc: 
    186         raise RuntimeError("compile failed.\n%s\n%s"%(command_str, exc.output)) 
     189        output = decode(exc.output) 
     190        raise RuntimeError("compile failed.\n%s\n%s"%(command_str, output)) 
    187191    if not os.path.exists(output): 
    188192        raise RuntimeError("compile failed.  File is in %r"%source) 
     
    383387        # leave room for f1/f2 results in case we need to compute beta for 1d models 
    384388        nout = 2 if self.info.have_Fq else 1 
    385         # plus 3 weight, volume, radius 
    386         self.result = np.empty(q_input.nq*nout + 3, self.dtype) 
     389        # +4 for total weight, shell volume, effective radius, form volume 
     390        self.result = np.empty(q_input.nq*nout + 4, self.dtype) 
    387391        self.real = (np.float32 if self.q_input.dtype == generate.F32 
    388392                     else np.float64 if self.q_input.dtype == generate.F64 
Note: See TracChangeset for help on using the changeset viewer.