Changeset 70e5f97 in sasview


Ignore:
Timestamp:
Apr 8, 2016 4:58:38 AM (9 years ago)
Author:
gonzalezm
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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
6afc14b
Parents:
be2775f (diff), 1780d8b (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.
Message:

Merge branch 'master' of https://github.com/SasView/sasview

Files:
18 edited

Legend:

Unmodified
Added
Removed
  • build_tools/jenkins_osx_build.sh

    re9e3e38 r1780d8b  
    11export PATH=$PATH:/usr/local/bin/ 
     2 
     3 
     4PYTHON=${PYTHON:-`which python`} 
     5EASY_INSTALL=${EASY_INSTALL:-`which easy_install`} 
     6PYLINT=${PYLINT:-`which pylint`} 
     7 
     8export PYTHONPATH=$PYTHONPATH:$WORKSPACE/sasview/utils 
     9export PYTHONPATH=$PYTHONPATH:$WORKSPACE/sasview/sasview-install 
     10export LC_ALL=en_US.UTF-8 
     11export LANG=en_US.UTF-8 
     12 
    213 
    314cd $WORKSPACE 
    415 
    5 export PYTHONPATH=$WORKSPACE/sasview-install:$WORKSPACE/utils:$PYTHONPATH 
     16# SASMODLES 
     17cd $WORKSPACE 
     18cd sasmodels 
    619 
    7 ########################################################################## 
    8 # Use git/svn scripts 
     20rm -rf build 
     21rm -rf dist 
    922 
    10 #  Check dependencies 
    11 cd $WORKSPACE 
    12 if [ ! -d "utils" ]; then 
    13     mkdir utils 
    14 fi 
     23$PYTHON setup.py clean 
     24$PYTHON setup.py build 
    1525 
    1626 
    17 # BUILD_CODE 
     27# SASMODLES - BUILD DOCS 
     28cd  doc 
     29make html 
     30 
    1831cd $WORKSPACE 
    19 /bin/sh -xe build_tools/jenkins_linux_build.sh 
     32cd sasmodels 
     33$PYTHON setup.py bdist_egg 
    2034 
    2135 
    22 # TEST_CODE 
     36# SASVIEW 
    2337cd $WORKSPACE 
    24 /bin/sh -xe build_tools/jenkins_linux_test.sh 
     38cd sasview 
     39rm -rf sasview-install 
     40mkdir  sasview-install 
     41rm -rf utils 
     42mkdir  utils 
     43rm -rf dist 
     44rm -rf build 
    2545 
    2646 
    27 # BUILD DOCS 
    28 export LC_ALL=en_US.UTF-8 
    29 export LANG=en_US.UTF-8 
     47# INSTALL SASMODELS 
    3048cd $WORKSPACE 
    31 python setup.py docs 
     49cd sasmodels 
     50cd dist 
     51$EASY_INSTALL -d $WORKSPACE/sasview/utils sasmodels*.egg 
    3252 
    3353 
    34 # BUILD_egg with new docs 
     54# BUILD SASVIEW 
    3555cd $WORKSPACE 
    36 python setup.py bdist_egg --skip-build 
     56cd sasview 
     57$PYTHON setup.py clean 
     58$PYTHON setup.py build 
     59$PYTHON setup.py docs 
    3760 
    3861 
    39 # PYLINT_CODE 
    40 #cd $WORKSPACE 
    41 #/bin/sh -xe build_tools/jenkins_linux_pylint.sh 
     62# SASVIEW BUILD_egg with new docs 
     63cd $WORKSPACE 
     64cd sasview 
     65python setup.py bdist_egg 
     66cd dist 
     67$EASY_INSTALL -d $WORKSPACE/sasview/sasview-install sasview*.egg 
     68 
     69# TEST 
     70cd $WORKSPACE 
     71cd sasview 
     72cd test 
     73$PYTHON utest_sasview.py 
     74 
     75# PYLINT 
     76cd $WORKSPACE 
     77cd sasview 
     78$PYLINT --rcfile "build_tools/pylint.rc" -f parseable sasview-install/sasview*.egg/sas sasview | tee  test/sasview.txt 
    4279 
    4380 
    4481# BUILD APP 
    45 cd $WORKSPACE/sasview 
     82cd $WORKSPACE 
     83cd sasview/sasview 
    4684python setup_mac.py py2app 
    4785 
    48 #cd $WORKSPACE/sasview/dist 
    49 #tar -czf `python -c "import pkg_resources;print '%s.tar.gz SasView-%s.app' % (pkg_resources.get_distribution('sasview').egg_name(),pkg_resources.get_distribution('sasview').version)"` 
  • check_packages.py

    r9d5427f r8e7044c  
    1919    'pylint':{'version':None,'import_name':'pylint','test':None}, 
    2020    'periodictable':{'version':'1.3.0','import_name':'periodictable','test':'__version__'}, 
    21     'bumps':{'version':'0.7.5.6','import_name':'bumps','test':'__version__'}, 
     21    'bumps':{'version':'0.7.5.7','import_name':'bumps','test':'__version__'}, 
    2222    'numpy':{'version':'1.6.1','import_name':'numpy','test':'__version__'}, 
    2323    'scipy':{'version':'0.10.1','import_name':'scipy','test':'__version__'}, 
  • docs/sphinx-docs/build_sphinx.py

    r5420ef6 r6de5e10  
    150150    if os.path.exists(SASMODELS_SOURCE_IMG): 
    151151        print "Found img  folder SASMODELS_SOURCE_IMG    at ", SASMODELS_SOURCE_IMG 
    152         if os.path.exists(SASMODELS_DEST_IMG): 
    153             print "Found img  folder SASMODELS_DEST_IMG      at ", SASMODELS_DEST_IMG 
    154             print "Copying sasmodels model image files..." 
    155             for files in os.listdir(SASMODELS_SOURCE_IMG): 
    156                 fromhere=os.path.join(SASMODELS_SOURCE_IMG,files) 
    157                 tohere=os.path.join(SASMODELS_DEST_IMG,files) 
    158                 shutil.copy(fromhere,tohere) 
     152        if not os.path.exists(SASMODELS_DEST_IMG): 
     153            print "Missing docs folder SASMODELS_DEST_IMG at ", SASMODELS_DEST_IMG 
     154            os.makedirs(SASMODELS_DEST_IMG) 
     155            print "created SASMODELS_DEST_BUILDIMG at ", SASMODELS_DEST_BUILDIMG 
     156        else: print "Found img  folder SASMODELS_DEST_IMG      at ", SASMODELS_DEST_IMG 
     157        print "Copying sasmodels model image files..." 
     158        for files in os.listdir(SASMODELS_SOURCE_IMG): 
     159            fromhere=os.path.join(SASMODELS_SOURCE_IMG,files) 
     160            tohere=os.path.join(SASMODELS_DEST_IMG,files) 
     161            shutil.copy(fromhere,tohere) 
     162    else: print "cannot find SASMODELS_SOURCE_IMG", SASMODELS_SOURCE_IMG 
    159163 
    160164    if os.path.exists(SASMODELS_SOURCE_AUTOIMG): 
    161165        print "Found img  folder SASMODELS_SOURCE_AUTOIMG    at ", SASMODELS_SOURCE_AUTOIMG 
    162         if os.path.exists(SASMODELS_DEST_IMG): 
    163             print "Copying sasmodels model auto-generated image files..." 
    164             for files in os.listdir(SASMODELS_SOURCE_AUTOIMG): 
    165                 fromhere=os.path.join(SASMODELS_SOURCE_AUTOIMG,files) 
    166                 tohere=os.path.join(SASMODELS_DEST_IMG,files) 
    167                 shutil.copy(fromhere,tohere) 
     166        if not os.path.exists(SASMODELS_DEST_IMG): 
     167            print "Missing docs folder SASMODELS_DEST_IMG at ", ASMODELS_DEST_IMG 
     168            os.makedirs(SASMODELS_DEST_BUILDIMG) 
     169            print "created SASMODELS_DEST_BUILDIMG at ", SASMODELS_DEST_BUILDIMG 
     170        print "Copying sasmodels model auto-generated image files..." 
     171        for files in os.listdir(SASMODELS_SOURCE_AUTOIMG): 
     172            fromhere=os.path.join(SASMODELS_SOURCE_AUTOIMG,files) 
     173            tohere=os.path.join(SASMODELS_DEST_IMG,files) 
     174            shutil.copy(fromhere,tohere) 
     175        else: print "no source directorty",SASMODELS_SOURCE_AUTOIMG ,"was found" 
    168176     
    169177    # And the rst prolog with the unit substitutions 
  • docs/sphinx-docs/source/user/sasgui/perspectives/fitting/optimizer.rst

    r49148bb re81f6dd  
    404404Like differential evolution, DREAM will evaluate $k$ points in parallel, 
    405405where $k$ is the size of the population. 
     406 
     407.. _option-burn: 
    406408 
    407409Options 
  • docs/sphinx-docs/source/user/shape-sphere.rst

    r61991ed r5e15bca  
    1212    models/adsorbed_layer.rst 
    1313    models/binary_hard_sphere.rst 
     14    models/core_multi_shell.rst 
    1415    models/core_shell_sphere.rst 
    1516    models/fuzzy_sphere.rst 
  • setup.py

    r9274711 rc8843be  
    55import sys 
    66import os 
     7import shutil 
    78from setuptools import setup, Extension 
    89from distutils.command.build_ext import build_ext 
    910from distutils.core import Command 
     11from shutil import rmtree 
    1012 
    1113try: 
     
    4244#                      'sum_Ap1_1_Ap2.pyc', 'sum_p1_p2.pyc', 
    4345#                      'testmodel_2.pyc', 'testmodel.pyc', 'plugins.log'] 
     46 
     47CURRENT_SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) 
     48SASVIEW_BUILD = os.path.join(CURRENT_SCRIPT_DIR, "build") 
     49 
    4450sas_dir = os.path.join(os.path.expanduser("~"),'.sasview') 
    4551if os.path.isdir(sas_dir): 
     
    5965    #             file_path =  os.path.join(f_path, f) 
    6066    #             os.remove(file_path) 
     67    if os.path.exists(SASVIEW_BUILD): 
     68        print "Removing existing build directory", SASVIEW_BUILD, "for a clean build" 
     69        shutil.rmtree(SASVIEW_BUILD) 
    6170                     
    6271# 'sys.maxsize' and 64bit: Not supported for python2.5 
  • src/sas/sascalc/calculator/BaseComponent.py

    r74c5521 r53aa66d  
    119119            q = [q[0], q[1], q[2], ....] 
    120120 
    121         ..note:: 
    122           Due to 2D speed issue, no anisotropic scattering 
    123           is supported for python models, thus C-models should have 
    124           their own evalDistribution methods. 
     121        .. note:: Due to 2D speed issue, no anisotropic scattering 
     122                  is supported for python models, thus C-models should have 
     123                  their own evalDistribution methods. 
    125124 
    126125        The method is then called the following way: :: 
  • src/sas/sascalc/calculator/c_extensions/libfunc.c

    r9e531f2 rb6c8abe  
    8585  } 
    8686  return sin(x)/x; 
    87 } 
    88  
    89  
    90 double gamln(double xx) { 
    91  
    92     double x,y,tmp,ser; 
    93     static double cof[6]={76.18009172947146,-86.50532032941677, 
    94     24.01409824083091,-1.231739572450155, 
    95     0.1208650973866179e-2,-0.5395239384953e-5}; 
    96     int j; 
    97  
    98     y=x=xx; 
    99     tmp=x+5.5; 
    100     tmp -= (x+0.5)*log(tmp); 
    101     ser=1.000000000190015; 
    102     for (j=0;j<=5;j++) ser += cof[j]/++y; 
    103     return -tmp+log(2.5066282746310005*ser/x); 
    10487} 
    10588 
     
    236219 
    237220/** 
    238    Implements eq 6.2.5 (small gamma) of Numerical Recipes in C, essentially 
    239    the incomplete gamma function multiplied by the gamma function. 
    240    Required for implementation of fast error function (erf) 
    241 **/ 
    242  
    243  
     221Wojtek's comment Mar 22 2016: The remaing code can mostly likely be deleated 
     222Keeping it in order to check if it is not breaking anything 
     223**/ 
     224 
     225/* 
    244226#define ITMAX 100 
    245227#define EPS 3.0e-7 
     
    250232  float sum,del,ap; 
    251233 
    252   *gln = gamln(a); 
     234  *gln = lgamma(a); 
    253235  if(x <= 0.0) { 
    254236    if (x < 0.0) printf("Error: x less than 0 in routine gser"); 
     
    273255  } 
    274256 
    275  
    276 } 
    277  
     257} 
     258*/ 
    278259/** 
    279260   Implements the incomplete gamma function Q(a,x) evaluated by its continued fraction 
    280261   representation 
    281262**/ 
    282  
     263/* 
    283264void gcf(float *gammcf, float a, float x, float *gln) { 
    284265  int i; 
    285266  float an,b,c,d,del,h; 
    286267 
    287   *gln = gamln(a); 
     268  *gln = lgamma(a); 
    288269  b = x+1.0-a; 
    289270  c = 1.0/FPMIN; 
     
    306287  return; 
    307288} 
    308  
    309  
     289*/ 
    310290/** 
    311291   Represents incomplete error function, P(a,x) 
    312292**/ 
     293/* 
    313294float gammp(float a, float x) { 
    314295  float gamser,gammcf,gln; 
     
    322303  } 
    323304} 
    324  
     305*/ 
    325306/** 
    326307    Implementation of the error function, erf(x) 
    327308**/ 
    328  
     309/* 
    329310float erff(float x) { 
    330311  return x < 0.0 ? -gammp(0.5,x*x) : gammp(0.5,x*x); 
    331312} 
    332  
     313*/ 
  • src/sas/sascalc/calculator/c_extensions/libfunc.h

    r9e531f2 rb6c8abe  
    1616double sinc(double x); 
    1717 
    18 double gamln(double x); 
     18//double gamln(double x); 
    1919 
    2020polar_sld cal_msld(int isangle, double qx, double qy, double bn, double m01, double mtheta1,  
    2121                        double mphi1, double spinfraci, double spinfracf, double spintheta); 
    2222 
    23 void gser(float *gamser, float a, float x, float *gln); 
     23//void gser(float *gamser, float a, float x, float *gln); 
    2424 
    25 void gcf(float *gammcf, float a, float x, float *gln); 
     25//void gcf(float *gammcf, float a, float x, float *gln); 
    2626 
    27 float gammp(float a,float x); 
     27//float gammp(float a,float x); 
    2828 
    29 float erff(float x); 
     29//float erff(float x); 
    3030 
    3131#endif 
  • src/sas/sasgui/guiframe/data_processor.py

    r74c5521 r468c253  
    1010The organization of the classes goes as: 
    1111 
    12 #Path to this is:           /sasview/src/sas/sasgui/guiframe/data_processor.py 
    13 #Path to image is:          /sasview/src/sas/sasgui/guiframe/media/BatchGridClassLayout.png 
    14  
    15 .. image:: ./guiframe/media/BatchGridClassLayout.png 
     12.. note:: Path to this is: /sasview/src/sas/sasgui/guiframe/data_processor.py 
     13 
     14.. note:: Path to image is: /sasview/src/sas/sasgui/guiframe/media/BatchGridClassLayout.png 
     15 
     16.. image:: ../../user/sasgui/guiframe/BatchGridClassLayout.png 
    1617   :align: center 
    1718 
     
    156157        attribute. 
    157158 
    158         NOTE: There is no need to override this if you don't need 
    159         to do something out of the ordinary. 
     159        .. note:: There is no need to override this if you don't need 
     160                  to do something out of the ordinary. 
    160161 
    161162        :param dc: the wxDC object for the paint 
  • src/sas/sasgui/perspectives/fitting/media/mag_help.rst

    r7805458 reca66a1  
    2222Magnetic scattering is implemented in five (2D) models  
    2323 
    24 *  *SphereModel* 
    25 *  *CoreShellModel* 
    26 *  *CoreMultiShellModel* 
    27 *  *CylinderModel* 
    28 *  *ParallelepipedModel* 
     24*  *sphere* 
     25*  *core_shell_sphere* 
     26*  *core_multi_shell* 
     27*  *cylinder* 
     28*  *parallelepiped* 
    2929 
    3030In general, the scattering length density (SLD, = |beta|) in each region where the 
  • src/sas/sasgui/perspectives/fitting/models.py

    rd85b0c7 r70e5f97  
    22    Utilities to manage models 
    33""" 
    4 import wx 
    54import imp 
    65import os 
    76import sys 
    8 import math 
    97import os.path 
    108# Time is needed by the log method 
     
    1311import py_compile 
    1412import shutil 
    15 from sas.sasgui.guiframe.events import StatusEvent 
    1613# Explicitly import from the pluginmodel module so that py2exe 
    1714# places it in the distribution. The Model1DPlugin class is used 
    1815# as the base class of plug-in models. 
    1916from sas.sascalc.fit.pluginmodel import Model1DPlugin 
    20 from sas.sascalc.calculator.BaseComponent import BaseComponent 
    2117from sas.sasgui.guiframe.CategoryInstaller import CategoryInstaller 
    22 from sasmodels import sasview_model,core 
     18from sasmodels.sasview_model import load_custom_model, load_standard_models 
    2319 
    2420 
     
    2723def get_model_python_path(): 
    2824    """ 
    29         Returns the python path for a model 
     25    Returns the python path for a model 
    3026    """ 
    3127    return os.path.dirname(__file__) 
     
    3430def log(message): 
    3531    """ 
    36         Log a message in a file located in the user's home directory 
     32    Log a message in a file located in the user's home directory 
    3733    """ 
    3834    dir = os.path.join(os.path.expanduser("~"), '.sasview', PLUGIN_DIR) 
     
    8783def find_plugins_dir(): 
    8884    """ 
    89         Find path of the plugins directory. 
    90         The plugin directory is located in the user's home directory. 
     85    Find path of the plugins directory. 
     86    The plugin directory is located in the user's home directory. 
    9187    """ 
    9288    dir = os.path.join(os.path.expanduser("~"), '.sasview', PLUGIN_DIR) 
     
    133129class ReportProblem: 
    134130    """ 
    135         Class to check for problems with specific values 
     131    Class to check for problems with specific values 
    136132    """ 
    137133    def __nonzero__(self): 
     
    159155 
    160156def _findModels(dir): 
    161     """ 
    162     """ 
    163157    # List of plugin objects 
    164158    plugins = {} 
     
    198192                    else: 
    199193                        filename = os.path.join(dir, item) 
    200                         plugins[name] = sasview_model.make_class_from_file(filename)  
     194                        plugins[name] = load_custom_model(filename) 
    201195 
    202196                except: 
     
    252246class ModelManagerBase: 
    253247    """ 
    254         Base class for the model manager 
     248    Base class for the model manager 
    255249    """ 
    256250    ## external dict for models 
     
    273267 
    274268    def __init__(self): 
    275         """ 
    276         """ 
    277269        self.model_dictionary = {} 
    278270        self.stored_plugins = {} 
     
    300292 
    301293        # regular model names only 
    302         base_message = "Unable to load model {0}" 
    303294        self.model_name_list = [] 
    304295 
    305296        #Build list automagically from sasmodels package 
    306         for model in sasview_model.standard_models(): 
     297        for model in load_standard_models(): 
    307298            self.model_dictionary[model._model_info['name']] = model 
    308299            if model._model_info['structure_factor'] == True: 
     
    328319        """ 
    329320        check the last time the plugin dir has changed and return true 
    330          is the directory was modified else return false 
     321        is the directory was modified else return false 
    331322        """ 
    332323        is_modified = False 
Note: See TracChangeset for help on using the changeset viewer.