Changeset 70e5f97 in sasview
- Timestamp:
- Apr 8, 2016 2:58:38 AM (9 years ago)
- 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. - Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
build_tools/jenkins_osx_build.sh
re9e3e38 r1780d8b 1 1 export PATH=$PATH:/usr/local/bin/ 2 3 4 PYTHON=${PYTHON:-`which python`} 5 EASY_INSTALL=${EASY_INSTALL:-`which easy_install`} 6 PYLINT=${PYLINT:-`which pylint`} 7 8 export PYTHONPATH=$PYTHONPATH:$WORKSPACE/sasview/utils 9 export PYTHONPATH=$PYTHONPATH:$WORKSPACE/sasview/sasview-install 10 export LC_ALL=en_US.UTF-8 11 export LANG=en_US.UTF-8 12 2 13 3 14 cd $WORKSPACE 4 15 5 export PYTHONPATH=$WORKSPACE/sasview-install:$WORKSPACE/utils:$PYTHONPATH 16 # SASMODLES 17 cd $WORKSPACE 18 cd sasmodels 6 19 7 ########################################################################## 8 # Use git/svn scripts 20 rm -rf build 21 rm -rf dist 9 22 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 15 25 16 26 17 # BUILD_CODE 27 # SASMODLES - BUILD DOCS 28 cd doc 29 make html 30 18 31 cd $WORKSPACE 19 /bin/sh -xe build_tools/jenkins_linux_build.sh 32 cd sasmodels 33 $PYTHON setup.py bdist_egg 20 34 21 35 22 # TEST_CODE36 # SASVIEW 23 37 cd $WORKSPACE 24 /bin/sh -xe build_tools/jenkins_linux_test.sh 38 cd sasview 39 rm -rf sasview-install 40 mkdir sasview-install 41 rm -rf utils 42 mkdir utils 43 rm -rf dist 44 rm -rf build 25 45 26 46 27 # BUILD DOCS 28 export LC_ALL=en_US.UTF-8 29 export LANG=en_US.UTF-8 47 # INSTALL SASMODELS 30 48 cd $WORKSPACE 31 python setup.py docs 49 cd sasmodels 50 cd dist 51 $EASY_INSTALL -d $WORKSPACE/sasview/utils sasmodels*.egg 32 52 33 53 34 # BUILD _egg with new docs54 # BUILD SASVIEW 35 55 cd $WORKSPACE 36 python setup.py bdist_egg --skip-build 56 cd sasview 57 $PYTHON setup.py clean 58 $PYTHON setup.py build 59 $PYTHON setup.py docs 37 60 38 61 39 # PYLINT_CODE 40 #cd $WORKSPACE 41 #/bin/sh -xe build_tools/jenkins_linux_pylint.sh 62 # SASVIEW BUILD_egg with new docs 63 cd $WORKSPACE 64 cd sasview 65 python setup.py bdist_egg 66 cd dist 67 $EASY_INSTALL -d $WORKSPACE/sasview/sasview-install sasview*.egg 68 69 # TEST 70 cd $WORKSPACE 71 cd sasview 72 cd test 73 $PYTHON utest_sasview.py 74 75 # PYLINT 76 cd $WORKSPACE 77 cd sasview 78 $PYLINT --rcfile "build_tools/pylint.rc" -f parseable sasview-install/sasview*.egg/sas sasview | tee test/sasview.txt 42 79 43 80 44 81 # BUILD APP 45 cd $WORKSPACE/sasview 82 cd $WORKSPACE 83 cd sasview/sasview 46 84 python setup_mac.py py2app 47 85 48 #cd $WORKSPACE/sasview/dist49 #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 19 19 'pylint':{'version':None,'import_name':'pylint','test':None}, 20 20 '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__'}, 22 22 'numpy':{'version':'1.6.1','import_name':'numpy','test':'__version__'}, 23 23 'scipy':{'version':'0.10.1','import_name':'scipy','test':'__version__'}, -
docs/sphinx-docs/build_sphinx.py
r5420ef6 r6de5e10 150 150 if os.path.exists(SASMODELS_SOURCE_IMG): 151 151 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 159 163 160 164 if os.path.exists(SASMODELS_SOURCE_AUTOIMG): 161 165 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" 168 176 169 177 # And the rst prolog with the unit substitutions -
docs/sphinx-docs/source/user/sasgui/perspectives/fitting/optimizer.rst
r49148bb re81f6dd 404 404 Like differential evolution, DREAM will evaluate $k$ points in parallel, 405 405 where $k$ is the size of the population. 406 407 .. _option-burn: 406 408 407 409 Options -
docs/sphinx-docs/source/user/shape-sphere.rst
r61991ed r5e15bca 12 12 models/adsorbed_layer.rst 13 13 models/binary_hard_sphere.rst 14 models/core_multi_shell.rst 14 15 models/core_shell_sphere.rst 15 16 models/fuzzy_sphere.rst -
setup.py
r9274711 rc8843be 5 5 import sys 6 6 import os 7 import shutil 7 8 from setuptools import setup, Extension 8 9 from distutils.command.build_ext import build_ext 9 10 from distutils.core import Command 11 from shutil import rmtree 10 12 11 13 try: … … 42 44 # 'sum_Ap1_1_Ap2.pyc', 'sum_p1_p2.pyc', 43 45 # 'testmodel_2.pyc', 'testmodel.pyc', 'plugins.log'] 46 47 CURRENT_SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) 48 SASVIEW_BUILD = os.path.join(CURRENT_SCRIPT_DIR, "build") 49 44 50 sas_dir = os.path.join(os.path.expanduser("~"),'.sasview') 45 51 if os.path.isdir(sas_dir): … … 59 65 # file_path = os.path.join(f_path, f) 60 66 # 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) 61 70 62 71 # 'sys.maxsize' and 64bit: Not supported for python2.5 -
src/sas/sascalc/calculator/BaseComponent.py
r74c5521 r53aa66d 119 119 q = [q[0], q[1], q[2], ....] 120 120 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. 125 124 126 125 The method is then called the following way: :: -
src/sas/sascalc/calculator/c_extensions/libfunc.c
r9e531f2 rb6c8abe 85 85 } 86 86 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);104 87 } 105 88 … … 236 219 237 220 /** 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 221 Wojtek's comment Mar 22 2016: The remaing code can mostly likely be deleated 222 Keeping it in order to check if it is not breaking anything 223 **/ 224 225 /* 244 226 #define ITMAX 100 245 227 #define EPS 3.0e-7 … … 250 232 float sum,del,ap; 251 233 252 *gln = gamln(a);234 *gln = lgamma(a); 253 235 if(x <= 0.0) { 254 236 if (x < 0.0) printf("Error: x less than 0 in routine gser"); … … 273 255 } 274 256 275 276 } 277 257 } 258 */ 278 259 /** 279 260 Implements the incomplete gamma function Q(a,x) evaluated by its continued fraction 280 261 representation 281 262 **/ 282 263 /* 283 264 void gcf(float *gammcf, float a, float x, float *gln) { 284 265 int i; 285 266 float an,b,c,d,del,h; 286 267 287 *gln = gamln(a);268 *gln = lgamma(a); 288 269 b = x+1.0-a; 289 270 c = 1.0/FPMIN; … … 306 287 return; 307 288 } 308 309 289 */ 310 290 /** 311 291 Represents incomplete error function, P(a,x) 312 292 **/ 293 /* 313 294 float gammp(float a, float x) { 314 295 float gamser,gammcf,gln; … … 322 303 } 323 304 } 324 305 */ 325 306 /** 326 307 Implementation of the error function, erf(x) 327 308 **/ 328 309 /* 329 310 float erff(float x) { 330 311 return x < 0.0 ? -gammp(0.5,x*x) : gammp(0.5,x*x); 331 312 } 332 313 */ -
src/sas/sascalc/calculator/c_extensions/libfunc.h
r9e531f2 rb6c8abe 16 16 double sinc(double x); 17 17 18 double gamln(double x);18 //double gamln(double x); 19 19 20 20 polar_sld cal_msld(int isangle, double qx, double qy, double bn, double m01, double mtheta1, 21 21 double mphi1, double spinfraci, double spinfracf, double spintheta); 22 22 23 void gser(float *gamser, float a, float x, float *gln);23 //void gser(float *gamser, float a, float x, float *gln); 24 24 25 void gcf(float *gammcf, float a, float x, float *gln);25 //void gcf(float *gammcf, float a, float x, float *gln); 26 26 27 float gammp(float a,float x);27 //float gammp(float a,float x); 28 28 29 float erff(float x);29 //float erff(float x); 30 30 31 31 #endif -
src/sas/sasgui/guiframe/data_processor.py
r74c5521 r468c253 10 10 The organization of the classes goes as: 11 11 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 16 17 :align: center 17 18 … … 156 157 attribute. 157 158 158 NOTE: There is no need to override this if you don't need159 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. 160 161 161 162 :param dc: the wxDC object for the paint -
src/sas/sasgui/perspectives/fitting/media/mag_help.rst
r7805458 reca66a1 22 22 Magnetic scattering is implemented in five (2D) models 23 23 24 * * SphereModel*25 * * CoreShellModel*26 * * CoreMultiShellModel*27 * * CylinderModel*28 * * ParallelepipedModel*24 * *sphere* 25 * *core_shell_sphere* 26 * *core_multi_shell* 27 * *cylinder* 28 * *parallelepiped* 29 29 30 30 In general, the scattering length density (SLD, = |beta|) in each region where the -
src/sas/sasgui/perspectives/fitting/models.py
rd85b0c7 r70e5f97 2 2 Utilities to manage models 3 3 """ 4 import wx5 4 import imp 6 5 import os 7 6 import sys 8 import math9 7 import os.path 10 8 # Time is needed by the log method … … 13 11 import py_compile 14 12 import shutil 15 from sas.sasgui.guiframe.events import StatusEvent16 13 # Explicitly import from the pluginmodel module so that py2exe 17 14 # places it in the distribution. The Model1DPlugin class is used 18 15 # as the base class of plug-in models. 19 16 from sas.sascalc.fit.pluginmodel import Model1DPlugin 20 from sas.sascalc.calculator.BaseComponent import BaseComponent21 17 from sas.sasgui.guiframe.CategoryInstaller import CategoryInstaller 22 from sasmodels import sasview_model,core18 from sasmodels.sasview_model import load_custom_model, load_standard_models 23 19 24 20 … … 27 23 def get_model_python_path(): 28 24 """ 29 25 Returns the python path for a model 30 26 """ 31 27 return os.path.dirname(__file__) … … 34 30 def log(message): 35 31 """ 36 32 Log a message in a file located in the user's home directory 37 33 """ 38 34 dir = os.path.join(os.path.expanduser("~"), '.sasview', PLUGIN_DIR) … … 87 83 def find_plugins_dir(): 88 84 """ 89 90 85 Find path of the plugins directory. 86 The plugin directory is located in the user's home directory. 91 87 """ 92 88 dir = os.path.join(os.path.expanduser("~"), '.sasview', PLUGIN_DIR) … … 133 129 class ReportProblem: 134 130 """ 135 131 Class to check for problems with specific values 136 132 """ 137 133 def __nonzero__(self): … … 159 155 160 156 def _findModels(dir): 161 """162 """163 157 # List of plugin objects 164 158 plugins = {} … … 198 192 else: 199 193 filename = os.path.join(dir, item) 200 plugins[name] = sasview_model.make_class_from_file(filename)194 plugins[name] = load_custom_model(filename) 201 195 202 196 except: … … 252 246 class ModelManagerBase: 253 247 """ 254 248 Base class for the model manager 255 249 """ 256 250 ## external dict for models … … 273 267 274 268 def __init__(self): 275 """276 """277 269 self.model_dictionary = {} 278 270 self.stored_plugins = {} … … 300 292 301 293 # regular model names only 302 base_message = "Unable to load model {0}"303 294 self.model_name_list = [] 304 295 305 296 #Build list automagically from sasmodels package 306 for model in sasview_model.standard_models():297 for model in load_standard_models(): 307 298 self.model_dictionary[model._model_info['name']] = model 308 299 if model._model_info['structure_factor'] == True: … … 328 319 """ 329 320 check the last time the plugin dir has changed and return true 330 321 is the directory was modified else return false 331 322 """ 332 323 is_modified = False
Note: See TracChangeset
for help on using the changeset viewer.