Changeset 587cbcd in sasmodels


Ignore:
Timestamp:
Apr 11, 2017 7:39:31 AM (8 years ago)
Author:
GitHub <noreply@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
1cd24b4
Parents:
b2921d0 (diff), bccb40f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Andrew Jackson <andrew.jackson@…> (04/11/17 07:39:31)
git-committer:
GitHub <noreply@…> (04/11/17 07:39:31)
Message:

Merge pull request #40 from SasView?/ticket-695

Fix profile function to plot what the documentation says about the SL…

Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/onion.py

    rc3ccaec rbccb40f  
    11r""" 
    22This model provides the form factor, $P(q)$, for a multi-shell sphere where 
    3 the scattering length density (SLD) of the each shell is described by an 
     3the scattering length density (SLD) of each shell is described by an 
    44exponential, linear, or constant function. The form factor is normalized by 
    55the volume of the sphere where the SLD is not identical to the SLD of the 
     
    142142 
    143143For $A = 0$, the exponential function has no dependence on the radius (so that 
    144 $\rho_\text{out}$ is ignored this case) and becomes flat. We set the constant 
     144$\rho_\text{out}$ is ignored in this case) and becomes flat. We set the constant 
    145145to $\rho_\text{in}$ for convenience, and thus the form factor contributed by 
    146146the shells is 
     
    346346            # flat shell 
    347347            z.append(z_current + thickness[k]) 
    348             rho.append(sld_out[k]) 
     348            rho.append(sld_in[k]) 
    349349        else: 
    350350            # exponential shell 
     
    357357                z.append(z_current+z_shell) 
    358358                rho.append(slope*exp(A[k]*z_shell/thickness[k]) + const) 
    359  
     359     
    360360    # add in the solvent 
    361361    z.append(z[-1]) 
  • .travis.yml

    r01e551a r24cd982  
    11language: python 
    2 python: 
    3 - '2.7' 
     2 
     3sudo:  false 
     4 
     5matrix: 
     6  include: 
     7    - os: linux 
     8      env: 
     9        - PY=2.7 
     10        - NUMPYSPEC=numpy 
     11    - os: linux 
     12      env: 
     13        - PY=3 
     14        - NUMPYSPEC=numpy 
     15    - os: osx 
     16      language: generic 
     17      env: 
     18        - PY=2.7 
     19        - NUMPYSPEC=numpy 
     20    - os: osx 
     21      language: generic 
     22      env: 
     23        - PY=3 
     24        - NUMPYSPEC=numpy 
     25 
     26# whitelist 
    427branches: 
    528  only: 
    6   - master 
    7 virtualenv: 
    8   system_site_packages: true 
     29    - master 
     30 
     31addons: 
     32  apt: 
     33    packages: 
     34      opencl-headers 
     35 
    936before_install: 
    10 - sudo apt-get update; 
    11 - sudo apt-get install python-numpy python-scipy 
     37  - echo $TRAVIS_OS_NAME 
     38 
     39  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then 
     40      wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; 
     41    fi; 
     42  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then 
     43      wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh; 
     44    fi; 
     45 
     46  - bash miniconda.sh -b -p $HOME/miniconda 
     47  - export PATH="$HOME/miniconda/bin:$PATH" 
     48  - hash -r 
     49  - conda update --yes conda 
     50 
     51  # Useful for debugging any issues with conda 
     52  - conda info -a 
     53 
     54  - conda install --yes python=$PY $NUMPYSPEC scipy cython mako cffi 
     55 
     56  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then 
     57      pip install pyopencl; 
     58    fi; 
     59 
    1260install: 
    13 - pip install bumps 
    14 - pip install unittest-xml-reporting 
     61  - pip install bumps 
     62  - pip install unittest-xml-reporting 
     63 
    1564script: 
    1665- export WORKSPACE=/home/travis/build/SasView/sasmodels/ 
    1766- python -m sasmodels.model_test dll all 
     67 
    1868notifications: 
    1969  slack: 
  • sasmodels/kerneldll.py

    r886fa25 rb2f1d2f  
    9797 
    9898if "SAS_COMPILER" in os.environ: 
    99     compiler = os.environ["SAS_COMPILER"] 
     99    COMPILER = os.environ["SAS_COMPILER"] 
    100100elif os.name == 'nt': 
    101     # If vcvarsall.bat has been called, then VCINSTALLDIR is in the environment 
    102     # and we can use the MSVC compiler.  Otherwise, if tinycc is available 
    103     # the use it.  Otherwise, hope that mingw is available. 
    104     if "VCINSTALLDIR" in os.environ: 
    105         compiler = "msvc" 
    106     elif tinycc: 
    107         compiler = "tinycc" 
     101    if tinycc is not None: 
     102        COMPILER = "tinycc" 
     103    elif "VCINSTALLDIR" in os.environ: 
     104        # If vcvarsall.bat has been called, then VCINSTALLDIR is in the environment 
     105        # and we can use the MSVC compiler.  Otherwise, if tinycc is available 
     106        # the use it.  Otherwise, hope that mingw is available. 
     107        COMPILER = "msvc" 
    108108    else: 
    109         compiler = "mingw" 
     109        COMPILER = "mingw" 
    110110else: 
    111     compiler = "unix" 
     111    COMPILER = "unix" 
    112112 
    113113ARCH = "" if ct.sizeof(ct.c_void_p) > 4 else "x86"  # 4 byte pointers on x86 
    114 if compiler == "unix": 
     114if COMPILER == "unix": 
    115115    # Generic unix compile 
    116116    # On mac users will need the X code command line tools installed 
     
    123123        """unix compiler command""" 
    124124        return CC + [source, "-o", output, "-lm"] 
    125 elif compiler == "msvc": 
     125elif COMPILER == "msvc": 
    126126    # Call vcvarsall.bat before compiling to set path, headers, libs, etc. 
    127127    # MSVC compiler is available, so use it.  OpenMP requires a copy of 
     
    139139        """MSVC compiler command""" 
    140140        return CC + ["/Tp%s"%source] + LN + ["/OUT:%s"%output] 
    141 elif compiler == "tinycc": 
     141elif COMPILER == "tinycc": 
    142142    # TinyCC compiler. 
    143143    CC = [tinycc.TCC] + "-shared -rdynamic -Wall".split() 
     
    145145        """tinycc compiler command""" 
    146146        return CC + [source, "-o", output] 
    147 elif compiler == "mingw": 
     147elif COMPILER == "mingw": 
    148148    # MinGW compiler. 
    149149    CC = "gcc -shared -std=c99 -O2 -Wall".split() 
  • sasmodels/kernelpy.py

    rb397165 rdbfd471  
    235235            # exclude all q for that NaN.  Even better would be to have an 
    236236            # INVALID expression like the C models, but that is too expensive. 
    237             Iq = form() 
     237            Iq = np.asarray(form(), 'd') 
    238238            if np.isnan(Iq).any(): continue 
    239239 
Note: See TracChangeset for help on using the changeset viewer.