Changeset 9e531f2 in sasview
- Timestamp:
- Mar 20, 2016 3:59:32 PM (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.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:
- b85502d
- Parents:
- 0b709f2c
- Files:
-
- 4 added
- 5 edited
- 9 moved
Legend:
- Unmodified
- Added
- Removed
-
run.py
r50a77df r9e531f2 121 121 joinpath(build_path, 'sas', 'sascalc', 'pr', 'core')) 122 122 123 # Compiled modules need to be pulled from the build directory. 124 # Some packages are not where they are needed, so load them explicitly. 125 import sas.sascalc.calculator 126 sas.sascalc.calculator.core = import_package('sas.sascalc.calculator.core', 127 joinpath(build_path, 'sas', 'sascalc', 'calculator', 'core')) 123 128 124 129 # Pull the entire sas.models package from the build directory since it contains 125 130 # a mixture of autogenerated python and C. Any changes in models will require 126 131 # a rebuild with setup.py build 127 sas.models = import_package('sas.models', joinpath(build_path, 'sas', 'models'))132 # sas.models = import_package('sas.models', joinpath(build_path, 'sas', 'models')) 128 133 129 134 sys.path.append(build_path) -
setup.py
ra62945e r9e531f2 195 195 196 196 # sas.sascalc.calculator 197 package_dir["sas.sascalc.calculator"] =os.path.join("src", "sas", "sascalc", "calculator") 198 packages.extend(["sas.sascalc.calculator"]) 197 numpy_incl_path = os.path.join(NUMPY_INC, "numpy") 198 gen_dir = os.path.join("src", "sas", "sascalc", "calculator", "c_extensions") 199 package_dir["sas.sascalc.calculator.core"] = gen_dir 200 package_dir["sas.sascalc.calculator"] = os.path.join("src", "sas", "sascalc", "calculator") 201 packages.extend(["sas.sascalc.calculator","sas.sascalc.calculator.core"]) 202 ext_modules.append( Extension("sas.sascalc.calculator.core.sld2i", 203 sources = [ 204 os.path.join(gen_dir, "sld2i_module.cpp"), 205 os.path.join(gen_dir, "sld2i.cpp"), 206 os.path.join(gen_dir, "libfunc.c"), 207 os.path.join(gen_dir, "librefl.c"), 208 os.path.join(gen_dir, "winFuncs.c"), 209 ], 210 include_dirs=[numpy_incl_path, gen_dir], 211 ) 212 ) 213 199 214 200 215 # sas.sascalc.pr 201 numpy_incl_path = os.path.join(NUMPY_INC, "numpy")202 216 srcdir = os.path.join("src", "sas", "sascalc", "pr", "c_extensions") 203 217 package_dir["sas.sascalc.pr.core"] = srcdir … … 226 240 227 241 package_dir["sas.sasgui.perspectives.fitting"] = os.path.join("src", "sas", "sasgui", "perspectives", "fitting") 228 # package_dir["sas.sasgui.perspectives.fitting.plugin_models"] = os.path.join("src", "sas", "sasgui", "perspectives", "fitting", "plugin_models") 229 packages.extend(["sas.sasgui.perspectives.fitting",#"sas.sasgui.perspectives.fitting.plugin_models" 230 ]) 242 packages.extend(["sas.sasgui.perspectives.fitting"]) 231 243 package_data['sas.sasgui.perspectives.fitting'] = ['media/*'] 232 244 233 packages.extend(["sas.sasgui.perspectives", "sas.sasgui.perspectives.calculator"]) 245 packages.extend(["sas.sasgui.perspectives", "sas.sasgui.perspectives.calculator"]) 234 246 package_data['sas.sasgui.perspectives.calculator'] = ['images/*', 'media/*'] 235 247 … … 242 254 packages.append("sas.sasgui.plottools") 243 255 244 # sas models245 includedir = os.path.join("src", "sas", "models", "include")246 igordir = os.path.join("src", "sas", "models", "c_extension", "libigor")247 cephes_dir = os.path.join("src", "sas", "models", "c_extension", "cephes")248 c_model_dir = os.path.join("src", "sas", "models", "c_extension", "c_models")249 smear_dir = os.path.join("src", "sas", "models", "c_extension", "c_smearer")250 gen_dir = os.path.join("src", "sas", "models", "c_extension", "c_gen")251 # wrapper_dir = os.path.join("src", "sas", "models", "c_extension", "python_wrapper", "generated")252 model_dir = os.path.join("src", "sas","models")253 254 #if os.path.isdir(wrapper_dir):255 # for file in os.listdir(wrapper_dir):256 # file_path = os.path.join(wrapper_dir, file)257 # os.remove(file_path)258 #else:259 # os.makedirs(wrapper_dir)260 #sys.path.append(os.path.join("src", "sas", "models", "c_extension", "python_wrapper"))261 #from wrapping import generate_wrappers262 #generate_wrappers(header_dir = includedir,263 # output_dir = model_dir,264 # c_wrapper_dir = wrapper_dir)265 256 266 257 IGNORED_FILES = [".svn"] … … 278 269 _, ext = os.path.splitext(f) 279 270 if ext.lower() in EXTENSIONS and f not in IGNORED_FILES: 280 file_list.append(os.path.join(dir_path, f)) 271 file_list.append(os.path.join(dir_path, f)) 281 272 elif os.path.isdir(os.path.join(dir_path, f)) and \ 282 273 not f.startswith("."): … … 287 278 if ext.lower() in EXTENSIONS and\ 288 279 new_f not in IGNORED_FILES: 289 file_list.append(os.path.join(sub_dir, new_f)) 290 291 model_sources = [] 292 append_file(file_list=model_sources, dir_path=igordir) 293 append_file(file_list=model_sources, dir_path=c_model_dir) 294 # append_file(file_list=model_sources, dir_path=wrapper_dir) 295 296 # smear_sources = [] 297 # append_file(file_list=smear_sources, dir_path=smear_dir) 298 299 package_dir["sas.models"] = model_dir 300 package_dir["sas.models.sas_extension"] = os.path.join("src", "sas", "models", "sas_extension") 301 package_data['sas.models'] = [os.path.join('media', "*.*")] 302 package_data['sas.models'] += [os.path.join('media','img', "*.*")] 303 packages.extend(["sas.models","sas.models.sas_extension"]) 304 305 # smearer_sources = [os.path.join(smear_dir, "smearer.cpp"), 306 # os.path.join(smear_dir, "smearer_module.cpp")] 307 geni_sources = [os.path.join(gen_dir, "sld2i_module.cpp")] 308 if os.name=='nt': 309 # smearer_sources.append(os.path.join(igordir, "winFuncs.c")) 310 geni_sources.append(os.path.join(igordir, "winFuncs.c")) 311 312 c_models = [ 313 # Extension("sas.models.sas_extension.c_models", 314 # sources=model_sources, 315 # include_dirs=[ 316 # igordir, includedir, c_model_dir, numpy_incl_path, cephes_dir 317 # ], 318 # ), 319 320 # Smearer extension 321 # Extension("sas.models.sas_extension.smearer", 322 # sources = smearer_sources, 323 # include_dirs=[igordir, smear_dir, numpy_incl_path], 324 # ), 325 # 326 # Extension("sas.models.sas_extension.smearer2d_helper", 327 # sources = [ 328 # os.path.join(smear_dir, "smearer2d_helper_module.cpp"), 329 # os.path.join(smear_dir, "smearer2d_helper.cpp"), 330 # os.path.join(igordir, "winFuncs.c"), 331 # ], 332 # include_dirs=[smear_dir, numpy_incl_path], 333 # ), 334 # 335 Extension("sas.models.sas_extension.sld2i", 336 sources = [ 337 os.path.join(gen_dir, "sld2i_module.cpp"), 338 os.path.join(gen_dir, "sld2i.cpp"), 339 os.path.join(c_model_dir, "libfunc.c"), 340 os.path.join(c_model_dir, "librefl.c"), 341 os.path.join(igordir, "winFuncs.c"), 342 ], 343 include_dirs=[gen_dir, includedir, c_model_dir, numpy_incl_path], 344 ), 345 ] 280 file_list.append(os.path.join(sub_dir, new_f)) 346 281 347 282 # Comment out the following to avoid rebuilding all the models 348 ext_modules.extend(c_models) 349 350 packages.append("sas.models") 283 file_sources = [] 284 append_file(file_sources, gen_dir) 285 351 286 # SasView 352 353 287 package_dir["sas.sasview"] = "sasview" 354 288 package_data['sas.sasview'] = ['images/*', -
src/sas/sascalc/calculator/c_extensions/libfunc.c
r79492222 r9e531f2 3 3 #include <math.h> 4 4 5 #include "lib multifunc/libfunc.h"5 #include "libfunc.h" 6 6 7 7 #include <stdio.h> -
src/sas/sascalc/calculator/c_extensions/librefl.c
ra6d2e3b r9e531f2 4 4 5 5 #include <math.h> 6 #include "lib multifunc/librefl.h"6 #include "librefl.h" 7 7 #include <stdio.h> 8 8 #include <stdlib.h> 9 9 #if defined(_MSC_VER) 10 #include " ../libigor/winFuncs.h"10 #include "winFuncs.h" 11 11 #endif 12 12 -
src/sas/sascalc/calculator/c_extensions/sld2i.cpp
r79492222 r9e531f2 7 7 using namespace std; 8 8 extern "C" { 9 #include "lib multifunc/libfunc.h"10 #include "lib multifunc/librefl.h"9 #include "libfunc.h" 10 #include "librefl.h" 11 11 } 12 12 /** -
src/sas/sascalc/calculator/sas_gen.py
r06aaa75d r9e531f2 3 3 SAS generic computation and sld file readers 4 4 """ 5 from sas. models.BaseComponent import BaseComponent6 import sas. models.sas_extension.sld2i as mod5 from sas.sascalc.calculator.BaseComponent import BaseComponent 6 import sas.sascalc.calculator.core.sld2i as mod 7 7 from periodictable import formula 8 8 from periodictable import nsf -
src/sas/sasgui/perspectives/fitting/__init__.py
rd85c194 r9e531f2 39 39 data_files = [] 40 40 path = os.path.dirname(__file__) 41 p_path = os.path.join(path, 'plugin_models')42 for f in findall(p_path):43 data_files.append(('plugin_models', [f]))44 path = get_data_path(media="media")41 # p_path = os.path.join(path, 'plugin_models') 42 # for f in findall(p_path): 43 # data_files.append(('plugin_models', [f])) 44 # path = get_data_path(media="media") 45 45 for f in findall(path): 46 46 data_files.append(('media/fitting_media', [f])) -
src/sas/sasgui/perspectives/fitting/models.py
rab3ed7e r9e531f2 17 17 # places it in the distribution. The Model1DPlugin class is used 18 18 # as the base class of plug-in models. 19 from sas. models.pluginmodel import Model1DPlugin20 from sas. models.BaseComponent import BaseComponent19 from sas.sascalc.fit.pluginmodel import Model1DPlugin 20 from sas.sascalc.calculator.BaseComponent import BaseComponent 21 21 from sas.sasgui.guiframe.CategoryInstaller import CategoryInstaller 22 22 from sasmodels import sasview_model,core
Note: See TracChangeset
for help on using the changeset viewer.