Changeset 0a51f0d8 in sasview for sansmodels
- Timestamp:
- Aug 10, 2011 3:59:35 PM (13 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.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 21b1a43
- Parents:
- 371cb85
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/setup.py
r73f9a68 r0a51f0d8 12 12 import sys 13 13 import os 14 if len(sys.argv) == 1: 15 sys.argv.append('install') 14 16 15 17 16 from numpy.distutils.misc_util import get_numpy_include_dirs … … 49 48 class_list = ModelFactory().getAllModels() 50 49 for name in class_list: 51 odb = open("s rc/sans/models/pyre/%s.odb" % name, 'w')50 odb = open("sans/models/pyre/%s.odb" % name, 'w') 52 51 odb.write(createODBcontent(name)) 53 52 odb.close() 54 print "s rc/sans/models/pyre/%s.odb created" % name53 print "sans/models/pyre/%s.odb created" % name 55 54 56 55 # … … 73 72 74 73 # Build the module name 75 srcdir = "src/sans/models/c_extensions" 76 igordir = "src/sans/models/libigor" 74 srcdir = os.path.join("src", "sans", "models", "c_extensions") 75 igordir = os.path.join("src","sans", "models", "libigor") 76 c_model_dir = os.path.join("src", "sans", "models", "c_models") 77 smear_dir = os.path.join("src", "sans", "models", "c_smearer") 78 print "Installing SANS models" 77 79 78 print "Installing SANS models" 80 81 IGNORED_FILES = ["a.exe", 82 "__init__.py" 83 ".svn", 84 "lineparser.py", 85 "run.py", 86 "CGaussian.cpp", 87 "CLogNormal.cpp", 88 "CLorentzian.cpp", 89 "CSchulz.cpp", 90 "WrapperGenerator.py", 91 "wrapping.py", 92 "winFuncs.c"] 93 IGNORED_EXTENSIONS = [".h", ".txt", ".def", ".mm", ".hh", ".py"] 94 95 def append_file(file_list, dir_path): 96 """ 97 Add sources file to sources 98 """ 99 for f in os.listdir(dir_path): 100 if os.path.isfile(os.path.join(dir_path, f)): 101 _, ext = os.path.splitext(f) 102 if ext not in IGNORED_EXTENSIONS and f not in IGNORED_FILES: 103 file_list.append(os.path.join(dir_path, f)) 104 elif os.path.isdir(os.path.join(dir_path, f)) and \ 105 not f.startswith("."): 106 sub_dir = os.path.join(dir_path, f) 107 for new_f in os.listdir(sub_dir): 108 if os.path.isfile(os.path.join(sub_dir, new_f)): 109 _, ext = os.path.splitext(new_f) 110 if ext not in IGNORED_EXTENSIONS and\ 111 new_f not in IGNORED_FILES: 112 file_list.append(os.path.join(sub_dir, new_f)) 113 114 model_sources = [] 115 append_file(file_list=model_sources, dir_path=srcdir) 116 append_file(file_list=model_sources, dir_path=igordir) 117 append_file(file_list=model_sources, dir_path=c_model_dir) 118 smear_sources = [] 119 append_file(file_list=smear_sources, dir_path=smear_dir) 79 120 80 121 … … 91 132 92 133 # Use the pure python modules 93 package_dir = {"sans":"src/sans", 94 "sans.models.sans_extension":"src/sans/models/c_extensions", 134 package_dir = {"sans":os.path.join("src", "sans"), 135 "sans.models":os.path.join("src", "sans", "models"), 136 "sans.models.sans_extension":srcdir, 95 137 }, 96 138 package_data={'sans.models': [os.path.join('media', "*")]}, … … 99 141 100 142 ext_modules = [ Extension("sans.models.sans_extension.c_models", 101 sources = [ 102 "src/sans/models/c_models/c_models.cpp", 103 #srcdir+"/CSphereModel.c", 104 #srcdir+"/sphere.c", 105 "src/sans/models/c_models/CSphereModel.cpp", 106 "src/sans/models/c_models/CPearlNecklaceModel.cpp", 107 "src/sans/models/c_models/pearlnecklace.cpp", 108 srcdir+"/pearlnecklace.c", 109 "src/sans/models/c_models/COnionModel.cpp", 110 "src/sans/models/c_models/onion.cpp", 111 srcdir+"/onion.c", 112 "src/sans/models/c_models/CReflModel.cpp", 113 "src/sans/models/c_models/refl.cpp", 114 srcdir+"/refl.c", 115 "src/sans/models/c_models/CReflAdvModel.cpp", 116 "src/sans/models/c_models/refl_adv.cpp", 117 srcdir+"/refl_adv.c", 118 #srcdir+"/SquareWell.c", 119 "src/sans/models/c_models/CSquareWellStructure.cpp", 120 "src/sans/models/c_models/SquareWell.cpp", 121 #srcdir+"/StickyHS.c", 122 "src/sans/models/c_models/CStickyHSStructure.cpp", 123 "src/sans/models/c_models/StickyHS.cpp", 124 "src/sans/models/c_models/CHardsphereStructure.cpp", 125 "src/sans/models/c_models/Hardsphere.cpp", 126 #srcdir+"/DiamCyl.c", 127 "src/sans/models/c_models/CDiamCylFunc.cpp", 128 "src/sans/models/c_models/DiamCyl.cpp", 129 #srcdir+"/DiamEllip.c", 130 "src/sans/models/c_models/CDiamEllipFunc.cpp", 131 "src/sans/models/c_models/DiamEllip.cpp", 132 #srcdir+"/HayterMSA.c", 133 "src/sans/models/c_models/CHayterMSAStructure.cpp", 134 "src/sans/models/c_models/HayterMSA.cpp", 135 "src/sans/models/c_models/sphere.cpp", 136 srcdir+"/fuzzysphere.c", 137 "src/sans/models/c_models/CFuzzySphereModel.cpp", 138 "src/sans/models/c_models/fuzzysphere.cpp", 139 #srcdir+"/CCylinderModel.c", 140 "src/sans/models/c_models/CCylinderModel.cpp", 141 "src/sans/models/c_models/cylinder.cpp", 142 "src/sans/models/c_models/parameters.cpp", 143 "src/sans/models/c_models/dispersion_visitor.cpp", 144 srcdir+"/cylinder.c", 145 #srcdir+"/CParallelepiped.c", 146 "src/sans/models/c_models/CParallelepipedModel.cpp", 147 "src/sans/models/c_models/parallelepiped.cpp", 148 srcdir+"/parallelepiped.c", 149 "src/sans/models/c_models/CCSParallelepipedModel.cpp", 150 "src/sans/models/c_models/csparallelepiped.cpp", 151 srcdir+"/csparallelepiped.c", 152 #srcdir+"/CCoreShellCylinderModel.c", 153 "src/sans/models/c_models/CCoreShellCylinderModel.cpp", 154 "src/sans/models/c_models/coreshellcylinder.cpp", 155 srcdir+"/core_shell_cylinder.c", 156 #srcdir+"/CHollowCylinderModel.c", 157 "src/sans/models/c_models/CHollowCylinderModel.cpp", 158 "src/sans/models/c_models/hollowcylinder.cpp", 159 srcdir+"/hollow_cylinder.c", 160 #srcdir+"/CCoreShellModel.c", 161 #srcdir+"/core_shell.c", 162 "src/sans/models/c_models/CCoreShellModel.cpp", 163 "src/sans/models/c_models/coreshellsphere.cpp", 164 #srcdir+"/CEllipsoidModel.c", 165 "src/sans/models/c_models/CEllipsoidModel.cpp", 166 "src/sans/models/c_models/ellipsoid.cpp", 167 srcdir+"/ellipsoid.c", 168 "src/sans/models/c_models/CCoreFourShellModel.cpp", 169 "src/sans/models/c_models/corefourshell.cpp", 170 #srcdir+"/corefourshell.c", 171 #srcdir+"/CEllipticalCylinderModel.c", 172 "src/sans/models/c_models/CEllipticalCylinderModel.cpp", 173 "src/sans/models/c_models/ellipticalcylinder.cpp", 174 srcdir+"/elliptical_cylinder.c", 175 #srcdir+"/CTriaxialEllipsoidModel.c", 176 "src/sans/models/c_models/CTriaxialEllipsoidModel.cpp", 177 "src/sans/models/c_models/triaxialellipsoid.cpp", 178 srcdir+"/triaxial_ellipsoid.c", 179 #srcdir+"/CFlexibleCylinderModel.c", 180 "src/sans/models/c_models/CFlexibleCylinderModel.cpp", 181 "src/sans/models/c_models/flexiblecylinder.cpp", 182 srcdir+"/flexible_cylinder.c", 183 "src/sans/models/c_models/CFlexCylEllipXModel.cpp", 184 "src/sans/models/c_models/flexcyl_ellipX.cpp", 185 srcdir+"/flexcyl_ellipX.c", 186 "src/sans/models/c_models/CBarBellModel.cpp", 187 "src/sans/models/c_models/barbell.cpp", 188 srcdir+"/barbell.c", 189 "src/sans/models/c_models/CCappedCylinderModel.cpp", 190 "src/sans/models/c_models/capcyl.cpp", 191 srcdir+"/capcyl.c", 192 #srcdir+"/CStakedDisksModel.c", 193 "src/sans/models/c_models/CSCCrystalModel.cpp", 194 "src/sans/models/c_models/sc.cpp", 195 srcdir+"/sc.c", 196 "src/sans/models/c_models/CFCCrystalModel.cpp", 197 "src/sans/models/c_models/fcc.cpp", 198 srcdir+"/fcc.c", 199 "src/sans/models/c_models/CBCCrystalModel.cpp", 200 "src/sans/models/c_models/bcc.cpp", 201 srcdir+"/bcc.c", 202 "src/sans/models/c_models/CStackedDisksModel.cpp", 203 "src/sans/models/c_models/stackeddisks.cpp", 204 srcdir+"/stacked_disks.c", 205 #srcdir+"/CLamellarModel.c", 206 "src/sans/models/c_models/CLamellarModel.cpp", 207 "src/sans/models/c_models/lamellar.cpp", 208 srcdir+"/lamellar.c", 209 #srcdir+"/CLamellarFFHGModel.c", 210 "src/sans/models/c_models/CLamellarFFHGModel.cpp", 211 "src/sans/models/c_models/lamellarFF_HG.cpp", 212 #srcdir+"/lamellarFF_HG.c", 213 #srcdir+"/CLamellarPSModel.c", 214 "src/sans/models/c_models/CLamellarPSModel.cpp", 215 "src/sans/models/c_models/lamellarPS.cpp", 216 srcdir+"/lamellarPS.c", 217 #srcdir+"/CLamellarPSHGModel.c", 218 "src/sans/models/c_models/CLamellarPSHGModel.cpp", 219 "src/sans/models/c_models/lamellarPS_HG.cpp", 220 #srcdir+"/lamellarPS_HG.c", 221 "src/sans/models/c_models/CLamellarPCrystalModel.cpp", 222 "src/sans/models/c_models/lamellarPC.cpp", 223 #srcdir+"/lamellarPC.c", 224 #srcdir+"/COblateModel.c", 225 "src/sans/models/c_models/CCoreShellEllipsoidModel.cpp", 226 "src/sans/models/c_models/spheroid.cpp", 227 srcdir+"/spheroid.c", 228 #srcdir+"/COblateModel.c", 229 #"sans/models/c_models/COblateModel.cpp", 230 #"sans/models/c_models/oblate.cpp", 231 #srcdir+"/oblate.c", 232 #srcdir+"/CProlateModel.c", 233 #"sans/models/c_models/CProlateModel.cpp", 234 #"sans/models/c_models/prolate.cpp", 235 #srcdir+"/prolate.c", 236 #srcdir+"/CMultishellModel.c", 237 "src/sans/models/c_models/CMultiShellModel.cpp", 238 "src/sans/models/c_models/multishell.cpp", 239 #srcdir+"/multishell.c", 240 "src/sans/models/c_models/CSphereSLDModel.cpp", 241 "src/sans/models/c_models/spheresld.cpp", 242 srcdir+"/spheresld.c", 243 #srcdir+"/CVesicleModel.c", 244 "src/sans/models/c_models/CVesicleModel.cpp", 245 "src/sans/models/c_models/vesicle.cpp", 246 #srcdir+"/vesicle.c", 247 #srcdir+"/CBinaryHSModel.c", 248 "src/sans/models/c_models/CBinaryHSModel.cpp", 249 "src/sans/models/c_models/binaryHS.cpp", 250 "src/sans/models/c_models/CPoly_GaussCoil.cpp", 251 "src/sans/models/c_models/polygausscoil.cpp", 252 srcdir+"/rpa.c", 253 "src/sans/models/c_models/CRPAModel.cpp", 254 "src/sans/models/c_models/rpa.cpp", 255 #srcdir+"/fractal.c", 256 "src/sans/models/c_models/CFractalModel.cpp", 257 "src/sans/models/c_models/fractal.cpp", 258 srcdir+"/sld_cal.c", 259 "src/sans/models/c_models/CSLDCalFunc.cpp", 260 "src/sans/models/c_models/sld_cal.cpp", 261 #gammainc function need to imported from somewhere 262 #srcdir+"/polyexclvol.c", 263 #"sans/models/c_models/CPolymerExclVolModel.cpp", 264 #"sans/models/c_models/polyexclvol.cpp", 265 srcdir+"/libmultifunc/librefl.c", 266 srcdir+"/libmultifunc/libfunc.c", 267 #srcdir+"/polygausscoil.c", 268 #srcdir+"/binaryHS.c", 269 srcdir+"/disperser.c", 270 igordir+"/libCylinder.c", 271 igordir+"/libStructureFactor.c", 272 igordir+"/libSphere.c", 273 igordir+"/libTwoPhase.c", 274 srcdir+"/gaussian.c", 275 srcdir+"/CGaussian.c", 276 srcdir+"/logNormal.c", 277 srcdir+"/CLogNormal.c", 278 srcdir+"/schulz.c", 279 srcdir+"/CSchulz.c", 280 srcdir+"/lorentzian.c", 281 srcdir+"/CLorentzian.c" 282 ], 283 include_dirs=[igordir,srcdir,"src/sans/models/c_models",numpy_incl_path]), 143 sources=model_sources, 144 145 include_dirs=[igordir, srcdir, c_model_dir, numpy_incl_path]), 284 146 # Smearer extension 285 147 Extension("sans.models.sans_extension.smearer", 286 sources = [ 287 "src/sans/models/c_smearer/smearer_module.cpp", 288 "src/sans/models/c_smearer/smearer.cpp", 289 ], 290 include_dirs=["src/sans/models/c_smearer",numpy_incl_path]), 148 sources = [os.path.join(smear_dir, 149 "smearer.cpp"), 150 os.path.join(smear_dir, "smearer_module.cpp"),], 151 include_dirs=[smear_dir, numpy_incl_path]), 291 152 Extension("sans.models.sans_extension.smearer2d_helper", 292 sources = [ 293 "src/sans/models/c_smearer/smearer2d_helper_module.cpp", 294 "src/sans/models/c_smearer/smearer2d_helper.cpp", 295 ], 296 include_dirs=["src/sans/models/c_smearer",numpy_incl_path] 153 sources = [os.path.join(smear_dir, 154 "smearer2d_helper_module.cpp"), 155 os.path.join(smear_dir, "smearer2d_helper.cpp"),], 156 include_dirs=[smear_dir,numpy_incl_path] 297 157 ) 298 158 ]
Note: See TracChangeset
for help on using the changeset viewer.