Changeset 9e531f2 in sasview


Ignore:
Timestamp:
Mar 20, 2016 5:59:32 PM (4 years ago)
Author:
krzywon
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
Message:

Code Cleanup - Fix build?!?!

Files:
4 added
5 edited
9 moved

Legend:

Unmodified
Added
Removed
  • run.py

    r50a77df r9e531f2  
    121121                                  joinpath(build_path, 'sas', 'sascalc', 'pr', 'core')) 
    122122 
     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')) 
    123128 
    124129    # Pull the entire sas.models package from the build directory since it contains 
    125130    # a mixture of autogenerated python and C.  Any changes in models will require 
    126131    # 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')) 
    128133 
    129134    sys.path.append(build_path) 
  • setup.py

    ra62945e r9e531f2  
    195195 
    196196# sas.sascalc.calculator 
    197 package_dir["sas.sascalc.calculator"] =os.path.join("src", "sas", "sascalc", "calculator") 
    198 packages.extend(["sas.sascalc.calculator"]) 
     197numpy_incl_path = os.path.join(NUMPY_INC, "numpy") 
     198gen_dir = os.path.join("src", "sas", "sascalc", "calculator", "c_extensions") 
     199package_dir["sas.sascalc.calculator.core"] = gen_dir 
     200package_dir["sas.sascalc.calculator"] = os.path.join("src", "sas", "sascalc", "calculator") 
     201packages.extend(["sas.sascalc.calculator","sas.sascalc.calculator.core"]) 
     202ext_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 
    199214     
    200215# sas.sascalc.pr 
    201 numpy_incl_path = os.path.join(NUMPY_INC, "numpy") 
    202216srcdir  = os.path.join("src", "sas", "sascalc", "pr", "c_extensions") 
    203217package_dir["sas.sascalc.pr.core"] = srcdir 
     
    226240 
    227241package_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                  ]) 
     242packages.extend(["sas.sasgui.perspectives.fitting"]) 
    231243package_data['sas.sasgui.perspectives.fitting'] = ['media/*'] 
    232244 
    233 packages.extend(["sas.sasgui.perspectives", "sas.sasgui.perspectives.calculator"])     
     245packages.extend(["sas.sasgui.perspectives", "sas.sasgui.perspectives.calculator"]) 
    234246package_data['sas.sasgui.perspectives.calculator'] = ['images/*', 'media/*'] 
    235247     
     
    242254packages.append("sas.sasgui.plottools") 
    243255 
    244 # sas models 
    245 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_wrappers 
    262 #generate_wrappers(header_dir = includedir, 
    263 #                  output_dir = model_dir, 
    264 #                  c_wrapper_dir = wrapper_dir) 
    265256 
    266257IGNORED_FILES = [".svn"] 
     
    278269            _, ext = os.path.splitext(f) 
    279270            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)) 
    281272        elif os.path.isdir(os.path.join(dir_path, f)) and \ 
    282273                not f.startswith("."): 
     
    287278                    if ext.lower() in EXTENSIONS and\ 
    288279                         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)) 
    346281 
    347282# Comment out the following to avoid rebuilding all the models 
    348 ext_modules.extend(c_models) 
    349  
    350 packages.append("sas.models") 
     283file_sources = [] 
     284append_file(file_sources, gen_dir) 
     285 
    351286# SasView 
    352  
    353287package_dir["sas.sasview"] = "sasview" 
    354288package_data['sas.sasview'] = ['images/*',  
  • src/sas/sascalc/calculator/c_extensions/libfunc.c

    r79492222 r9e531f2  
    33#include <math.h> 
    44 
    5 #include "libmultifunc/libfunc.h" 
     5#include "libfunc.h" 
    66 
    77#include <stdio.h> 
  • src/sas/sascalc/calculator/c_extensions/librefl.c

    ra6d2e3b r9e531f2  
    44 
    55#include <math.h> 
    6 #include "libmultifunc/librefl.h" 
     6#include "librefl.h" 
    77#include <stdio.h> 
    88#include <stdlib.h> 
    99#if defined(_MSC_VER) 
    10 #include "../libigor/winFuncs.h" 
     10#include "winFuncs.h" 
    1111#endif 
    1212 
  • src/sas/sascalc/calculator/c_extensions/sld2i.cpp

    r79492222 r9e531f2  
    77using namespace std; 
    88extern "C" { 
    9         #include "libmultifunc/libfunc.h" 
    10         #include "libmultifunc/librefl.h" 
     9        #include "libfunc.h" 
     10        #include "librefl.h" 
    1111} 
    1212/** 
  • src/sas/sascalc/calculator/sas_gen.py

    r06aaa75d r9e531f2  
    33SAS generic computation and sld file readers 
    44""" 
    5 from sas.models.BaseComponent import BaseComponent 
    6 import sas.models.sas_extension.sld2i as mod 
     5from sas.sascalc.calculator.BaseComponent import BaseComponent 
     6import sas.sascalc.calculator.core.sld2i as mod 
    77from periodictable import formula 
    88from periodictable import nsf 
  • src/sas/sasgui/perspectives/fitting/__init__.py

    rd85c194 r9e531f2  
    3939    data_files = [] 
    4040    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") 
    4545    for f in findall(path): 
    4646        data_files.append(('media/fitting_media', [f])) 
  • src/sas/sasgui/perspectives/fitting/models.py

    rab3ed7e r9e531f2  
    1717# places it in the distribution. The Model1DPlugin class is used 
    1818# as the base class of plug-in models. 
    19 from sas.models.pluginmodel import Model1DPlugin 
    20 from sas.models.BaseComponent import BaseComponent 
     19from sas.sascalc.fit.pluginmodel import Model1DPlugin 
     20from sas.sascalc.calculator.BaseComponent import BaseComponent 
    2121from sas.sasgui.guiframe.CategoryInstaller import CategoryInstaller 
    2222from sasmodels import sasview_model,core 
Note: See TracChangeset for help on using the changeset viewer.