Changeset 66000ae in sasview for src/sas/sasgui/perspectives/fitting


Ignore:
Timestamp:
Sep 25, 2017 5:01:30 PM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
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, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
fca1f50, 83db1cc
Parents:
dba8557 (diff), 72d3f1e (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 'ticket-869' into ticket-887-reorg

Location:
src/sas/sasgui/perspectives/fitting
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/fitpage.py

    r13374be r48154abb  
    20422042            # Save state_fit 
    20432043            self.save_current_state_fit() 
     2044            self.onSmear(None) 
     2045            self._onDraw(None) 
    20442046        except: 
    20452047            self._show_combox_helper() 
  • src/sas/sasgui/perspectives/fitting/pagestate.py

    rda9b239 r1fa4f736  
    12971297                                            namespaces={'ns': CANSAS_NS}) 
    12981298                    for entry in entry_list: 
    1299                         try: 
    1300                             sas_entry, _ = self._parse_save_state_entry(entry) 
    1301                         except: 
    1302                             raise 
    13031299                        fitstate = self._parse_state(entry) 
    1304  
    13051300                        # state could be None when .svs file is loaded 
    13061301                        # in this case, skip appending to output 
    13071302                        if fitstate is not None: 
     1303                            try: 
     1304                                sas_entry, _ = self._parse_save_state_entry( 
     1305                                    entry) 
     1306                            except: 
     1307                                raise 
    13081308                            sas_entry.meta_data['fitstate'] = fitstate 
    13091309                            sas_entry.filename = fitstate.file 
  • src/sas/sasgui/perspectives/fitting/simfitpage.py

    ra9f9ca4 r9804394  
    10731073        """ 
    10741074 
    1075         model_map = {} 
     1075        init_map = {} 
     1076        final_map = {} 
    10761077        if fit.fit_panel.sim_page is None: 
    10771078            fit.fit_panel.add_sim_page() 
     
    10871088                save_id = self._format_id(save_id) 
    10881089                if save_id == model_id: 
    1089                     model_map[saved_model.pop('fit_page_source')] = \ 
    1090                         model[3].name 
     1090                    inter_id = str(i) + str(i) + str(i) + str(i) + str(i) 
     1091                    init_map[saved_model.pop('fit_page_source')] = inter_id 
     1092                    final_map[inter_id] = model[3].name 
    10911093                    check = bool(saved_model.pop('checked')) 
    10921094                    sim_page.model_list[i][0].SetValue(check) 
     
    11061108                param = item.pop('param_cbox') 
    11071109                equality = item.pop('egal_txt') 
    1108                 for key, value in model_map.iteritems(): 
    1109                     model_cbox.replace(key, value) 
    1110                     constraint_value.replace(key, value) 
     1110                for key, value in init_map.items(): 
     1111                    model_cbox = model_cbox.replace(key, value) 
     1112                    constraint_value = constraint_value.replace(key, value) 
     1113                for key, value in final_map.items(): 
     1114                    model_cbox = model_cbox.replace(key, value) 
     1115                    constraint_value = constraint_value.replace(key, value) 
    11111116 
    11121117                sim_page.constraints_list[index][0].SetValue(model_cbox) 
  • src/sas/sasgui/perspectives/fitting/__init__.py

    r959eb01 r12d3e0e  
    1313    # Check for data path next to exe/zip file. 
    1414    # If we are inside a py2exe zip file, we need to go up 
    15     # to get to the directory containing  
     15    # to get to the directory containing 
    1616    # the media for this module 
    1717    path = os.path.dirname(__file__) 
     
    2626                return module_media_path 
    2727            return media_path 
    28     
     28 
    2929    raise RuntimeError('Could not find models media files') 
    3030 
     
    3232    """ 
    3333    Return the data files associated with media. 
    34      
     34 
    3535    The format is a list of (directory, [files...]) pairs which can be 
    3636    used directly in setup(...,data_files=...) for setup.py. 
     
    3838    """ 
    3939    data_files = [] 
    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") 
    45     for f in findall(path): 
    46         data_files.append(('media/fitting_media', [f])) 
    47      
     40    # Note: windows installer requires the plugin_models directory 
     41    plugin_models = os.path.join(os.path.dirname(__file__), "plugin_models") 
     42    data_files.append(('plugin_models', findall(plugin_models))) 
     43    data_files.append(('media/fitting_media', findall(get_data_path("media")))) 
     44 
    4845    return data_files 
  • src/sas/sasgui/perspectives/fitting/models.py

    r13374be r724af06  
    1515import shutil 
    1616from copy import copy 
     17 
     18from sasmodels.sasview_model import load_custom_model, load_standard_models 
     19 
    1720# Explicitly import from the pluginmodel module so that py2exe 
    1821# places it in the distribution. The Model1DPlugin class is used 
    1922# as the base class of plug-in models. 
     23from sas.sasgui import get_user_dir 
    2024from sas.sascalc.fit.pluginmodel import Model1DPlugin 
    2125from sas.sasgui.guiframe.CategoryInstaller import CategoryInstaller 
    22 from sasmodels.sasview_model import load_custom_model, load_standard_models 
    2326from sas.sasgui.perspectives.fitting.fitpage import CUSTOM_MODEL 
    2427 
     
    2730 
    2831PLUGIN_DIR = 'plugin_models' 
    29 PLUGIN_LOG = os.path.join(os.path.expanduser("~"), '.sasview', PLUGIN_DIR, 
    30                           "plugins.log") 
     32PLUGIN_LOG = os.path.join(get_user_dir(), PLUGIN_DIR, "plugins.log") 
    3133PLUGIN_NAME_BASE = '[plug-in] ' 
    3234 
Note: See TracChangeset for help on using the changeset viewer.