Changeset 74bec30 in sasmodels


Ignore:
Timestamp:
Nov 20, 2018 4:31:56 AM (3 weeks ago)
Author:
GitHub <noreply@…>
Parents:
119073a (diff), 646eeaa (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:
Paul Kienzle <pkienzle@…> (11/20/18 04:31:56)
git-committer:
GitHub <noreply@…> (11/20/18 04:31:56)
Message:

Merge 646eeaac78d6bddd6665964f7b98c4c6b21b133b into 119073a61da4bc8256d0f33c999a38f346f9dfc6

Files:
3 added
4 edited
6 moved

Legend:

Unmodified
Added
Removed
  • .gitignore

    re9ed2de r6ceca44  
    88*.so 
    99*.obj 
     10*.o 
    1011/doc/_build/ 
    1112/doc/api/ 
     
    1920/.pydevproject 
    2021/.idea 
     22.vscode 
    2123/sasmodels.egg-info/ 
    2224/example/Fit_*/ 
  • sasmodels/modelinfo.py

    r39a06c9 r765d025  
    1212from os.path import abspath, basename, splitext 
    1313import inspect 
     14import logging 
    1415 
    1516import numpy as np  # type: ignore 
     17 
     18from . import autoc 
    1619 
    1720# Optional typing 
     
    3235    TestCondition = Tuple[ParameterSetUser, TestInput, TestValue] 
    3336# pylint: enable=unused-import 
     37 
     38logger = logging.getLogger(__name__) 
    3439 
    3540# If MAX_PD changes, need to change the loop macros in kernel_iq.c 
     
    810815    info.profile = getattr(kernel_module, 'profile', None) # type: ignore 
    811816    info.sesans = getattr(kernel_module, 'sesans', None) # type: ignore 
    812     # Default single and opencl to True for C models.  Python models have callable Iq. 
    813     info.opencl = getattr(kernel_module, 'opencl', not callable(info.Iq)) 
    814     info.single = getattr(kernel_module, 'single', not callable(info.Iq)) 
    815817    info.random = getattr(kernel_module, 'random', None) 
    816818 
     
    821823    info.hidden = getattr(kernel_module, 'hidden', None) # type: ignore 
    822824 
     825    info.lineno = {} 
     826    _find_source_lines(info, kernel_module) 
     827    if getattr(kernel_module, 'py2c', False): 
     828        try: 
     829            warnings = autoc.convert(info, kernel_module) 
     830        except Exception as exc: 
     831            warnings = [str(exc)] 
     832        if warnings: 
     833            warnings.append("while converting %s from C to python"%name) 
     834            if len(warnings) > 2: 
     835                warnings = "\n".join(warnings) 
     836            else: 
     837                warnings = " ".join(warnings) 
     838            logger.warn(warnings) 
     839 
     840    # Default single and opencl to True for C models.  Python models have callable Iq. 
     841    # Needs to come after autoc.convert since the Iq symbol may have been 
     842    # converted from python to C 
     843    info.opencl = getattr(kernel_module, 'opencl', not callable(info.Iq)) 
     844    info.single = getattr(kernel_module, 'single', not callable(info.Iq)) 
     845 
    823846    if callable(info.Iq) and parameters.has_2d: 
    824847        raise ValueError("oriented python models not supported") 
    825848 
    826     info.lineno = {} 
    827     _find_source_lines(info, kernel_module) 
    828849    return info 
    829850 
  • explore/beta/sasfit_compare.py

    r2a12351b r119073a  
    505505    } 
    506506 
    507     Q, IQ = load_sasfit(data_file('richard_test.txt')) 
    508     Q, IQSD = load_sasfit(data_file('richard_test2.txt')) 
    509     Q, IQBD = load_sasfit(data_file('richard_test3.txt')) 
     507    Q, IQ = load_sasfit(data_file('sasfit_sphere_schulz_IQD.txt')) 
     508    Q, IQSD = load_sasfit(data_file('sasfit_sphere_schulz_IQSD.txt')) 
     509    Q, IQBD = load_sasfit(data_file('sasfit_sphere_schulz_IQBD.txt')) 
    510510    target = Theory(Q=Q, F1=None, F2=None, P=IQ, S=None, I=IQSD, Seff=None, Ibeta=IQBD) 
    511511    actual = sphere_r(Q, norm="sasfit", **pars) 
     
    526526    } 
    527527 
    528     Q, IQ = load_sasfit(data_file('richard_test4.txt')) 
    529     Q, IQSD = load_sasfit(data_file('richard_test5.txt')) 
    530     Q, IQBD = load_sasfit(data_file('richard_test6.txt')) 
     528    Q, IQ = load_sasfit(data_file('sasfit_ellipsoid_shulz_IQD.txt')) 
     529    Q, IQSD = load_sasfit(data_file('sasfit_ellipsoid_shulz_IQSD.txt')) 
     530    Q, IQBD = load_sasfit(data_file('sasfit_ellipsoid_shulz_IQBD.txt')) 
    531531    target = Theory(Q=Q, F1=None, F2=None, P=IQ, S=None, I=IQSD, Seff=None, Ibeta=IQBD) 
    532532    actual = ellipsoid_pe(Q, norm="sasfit", **pars) 
  • sasmodels/models/pearl_necklace.c

    r99658f6 r9b5fd42  
    4040    const double si = sas_sinx_x(q*A_s); 
    4141    const double omsi = 1.0 - si; 
    42     const double pow_si = pow(si, num_pearls); 
     42    const double pow_si = pown(si, num_pearls); 
    4343 
    4444    // form factor for num_pearls 
     
    8181radius_from_volume(double radius, double edge_sep, double thick_string, double fp_num_pearls) 
    8282{ 
    83     const int num_pearls = (int) fp_num_pearls +0.5; 
    8483    const double vol_tot = form_volume(radius, edge_sep, thick_string, fp_num_pearls); 
    8584    return cbrt(vol_tot/M_4PI_3); 
Note: See TracChangeset for help on using the changeset viewer.