Changeset cb9640f in sasview
- Timestamp:
- Dec 17, 2018 7:15:53 AM (6 years ago)
- Branches:
- master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249
- Children:
- dcd6efd
- Parents:
- 33d3a74 (diff), 93b34cc (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. - git-author:
- Wojciech Potrzebowski <Wojciech.Potrzebowski@…> (12/17/18 07:15:53)
- git-committer:
- GitHub <noreply@…> (12/17/18 07:15:53)
- Location:
- src/sas
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/_config.py
rb963b20 r93b34cc 86 86 def setup_custom_config(app_dir, user_dir): 87 87 path = make_custom_config_path(user_dir) 88 #logger.info("custom config path %s", path) 88 89 if not os.path.isfile(path): 89 90 try: … … 94 95 logger.error("Could not copy default custom config.") 95 96 97 custom_config = load_custom_config(path) 98 96 99 #Adding SAS_OPENCL if it doesn't exist in the config file 97 100 # - to support backcompability 98 if not "SAS_OPENCL" in open(path).read(): 101 if not hasattr(custom_config, "SAS_OPENCL"): 102 custom_config.SAS_OPENCL = None 99 103 try: 100 open( config_file, "a+").write("SAS_OPENCL = \"None\"\n")104 open(path, "a+").write("SAS_OPENCL = \"None\"\n") 101 105 except Exception: 102 106 logger.error("Could not update custom config with SAS_OPENCL.") 103 107 104 custom_config = load_custom_config(path)105 108 return custom_config 106 107 109 108 110 def load_custom_config(path): -
src/sas/sasgui/guiframe/gui_manager.py
r8ac05a5 r47be5a1 62 62 SPLASH_SCREEN_HEIGHT = config.SPLASH_SCREEN_HEIGHT 63 63 SS_MAX_DISPLAY_TIME = config.SS_MAX_DISPLAY_TIME 64 if not WELCOME_PANEL_ON: 65 WELCOME_PANEL_SHOW = False 64 65 def custom_value(name, default=None): 66 """ 67 Fetch a config value from custom_config. Fallback to config, and then 68 to default if it doesn't exist in config. 69 """ 70 default = getattr(config, name, default) 71 return getattr(custom_config, name, default) 72 73 # Custom config values in the order they appear. 74 DATAPANEL_WIDTH = custom_value('DATAPANEL_WIDTH', -1) 75 CLEANUP_PLOT = custom_value('CLEANUP_PLOT', False) 76 FIXED_PANEL = custom_value('FIXED_PANEL', True) 77 PLOPANEL_WIDTH = custom_value('PLOPANEL_WIDTH', -1) 78 DATALOADER_SHOW = custom_value('DATALOADER_SHOW', True) 79 GUIFRAME_HEIGHT = custom_value('GUIFRAME_HEIGHT', -1) 80 GUIFRAME_WIDTH = custom_value('GUIFRAME_WIDTH', -1) 81 CONTROL_WIDTH = custom_value('CONTROL_WIDTH', -1) 82 CONTROL_HEIGHT = custom_value('CONTROL_HEIGHT', -1) 83 open_folder = custom_value('DEFAULT_OPEN_FOLDER', None) 84 if open_folder is not None and os.path.isdir(open_folder): 85 DEFAULT_OPEN_FOLDER = os.path.abspath(open_folder) 66 86 else: 67 WELCOME_PANEL_SHOW = True68 try:69 DATALOADER_SHOW = custom_config.DATALOADER_SHOW70 TOOLBAR_SHOW = custom_config.TOOLBAR_SHOW71 FIXED_PANEL = custom_config.FIXED_PANEL72 if WELCOME_PANEL_ON:73 WELCOME_PANEL_SHOW = custom_config.WELCOME_PANEL_SHOW74 PLOPANEL_WIDTH = custom_config.PLOPANEL_WIDTH75 DATAPANEL_WIDTH = custom_config.DATAPANEL_WIDTH76 GUIFRAME_WIDTH = custom_config.GUIFRAME_WIDTH77 GUIFRAME_HEIGHT = custom_config.GUIFRAME_HEIGHT78 CONTROL_WIDTH = custom_config.CONTROL_WIDTH79 CONTROL_HEIGHT = custom_config.CONTROL_HEIGHT80 DEFAULT_PERSPECTIVE = custom_config.DEFAULT_PERSPECTIVE81 CLEANUP_PLOT = custom_config.CLEANUP_PLOT82 # custom open_path83 open_folder = custom_config.DEFAULT_OPEN_FOLDER84 if open_folder is not None and os.path.isdir(open_folder):85 DEFAULT_OPEN_FOLDER = os.path.abspath(open_folder)86 else:87 DEFAULT_OPEN_FOLDER = get_app_dir()88 SAS_OPENCL = custom_config.SAS_OPENCL89 except:90 DATALOADER_SHOW = True91 TOOLBAR_SHOW = True92 FIXED_PANEL = True93 WELCOME_PANEL_SHOW = False94 PLOPANEL_WIDTH = config.PLOPANEL_WIDTH95 DATAPANEL_WIDTH = config.DATAPANEL_WIDTH96 GUIFRAME_WIDTH = config.GUIFRAME_WIDTH97 GUIFRAME_HEIGHT = config.GUIFRAME_HEIGHT98 CONTROL_WIDTH = -199 CONTROL_HEIGHT = -1100 DEFAULT_PERSPECTIVE = None101 CLEANUP_PLOT = False102 87 DEFAULT_OPEN_FOLDER = get_app_dir() 103 DEFAULT_OPEN_FOLDER = PATH_APP 104 SAS_OPENCL = None 88 WELCOME_PANEL_SHOW = (custom_value('WELCOME_PANEL_SHOW', False) 89 if WELCOME_PANEL_ON else False) 90 TOOLBAR_SHOW = custom_value('TOOLBAR_SHOW', True) 91 DEFAULT_PERSPECTIVE = custom_value('DEFAULT_PERSPECTIVE', 'Fitting') 92 SAS_OPENCL = custom_value('SAS_OPENCL', 'None') 93 105 94 DEFAULT_STYLE = config.DEFAULT_STYLE 106 107 95 PLUGIN_STATE_EXTENSIONS = config.PLUGIN_STATE_EXTENSIONS 108 96 OPEN_SAVE_MENU = config.OPEN_SAVE_PROJECT_MENU … … 2170 2158 # original 2.x tutorial. 2171 2159 # Code below, implemented from 4.2.0, redirects 2172 # action to the Tutorials page of the help 2160 # action to the Tutorials page of the help 2173 2161 # documentation to give access to all available 2174 2162 # tutorials -
src/sas/sascalc/dataloader/file_reader_base_class.py
r4a8d55c rfee520ec 276 276 dataset.xmax = np.max(dataset.qx_data) 277 277 dataset.ymin = np.min(dataset.qy_data) 278 dataset.ymax = np.max(dataset.q x_data)278 dataset.ymax = np.max(dataset.qy_data) 279 279 280 280 def format_unit(self, unit=None): -
src/sas/sasgui/perspectives/calculator/model_editor.py
r9bf40e7 r1752f38 965 965 out_f.write(' """Absolute scattering"""\n') 966 966 if "scipy." in func_str: 967 out_f.write(' import scipy ')967 out_f.write(' import scipy\n') 968 968 if "numpy." in func_str: 969 out_f.write(' import numpy ')969 out_f.write(' import numpy\n') 970 970 if "np." in func_str: 971 out_f.write(' import numpy as np ')971 out_f.write(' import numpy as np\n') 972 972 for func_line in func_str.split('\n'): 973 973 out_f.write('%s%s\n' % (' ', func_line)) -
src/sas/sasgui/perspectives/fitting/fitting.py
raba4559 ra5cffe5 776 776 :param weight: current dy data 777 777 """ 778 # If we are not dealing with a specific fit problem, then 779 # there is no point setting the weights. 780 if fid is None: 781 return 778 # Note: this is used to set the data weights for the fit based on 779 # the weight selection in the GUI. 782 780 if uid in self.page_finder.keys(): 783 781 self.page_finder[uid].set_weight(flag=flag, is2d=is2d) -
src/sas/sasgui/perspectives/fitting/gpu_options.py
r8e109f9 r895703d 23 23 import sasmodels 24 24 import sasmodels.model_test 25 import sasmodels. kernelcl25 import sasmodels.sasview_model 26 26 27 27 from sas.sasgui.guiframe.documentation_window import DocumentationWindow … … 239 239 if "SAS_OPENCL" in os.environ: 240 240 del os.environ["SAS_OPENCL"] 241 sasmodels. kernelcl.reset_environment()241 sasmodels.sasview_model.reset_environment() 242 242 event.Skip() 243 243 … … 265 265 if "SAS_OPENCL" in os.environ: 266 266 del os.environ["SAS_OPENCL"] 267 sasmodels. kernelcl.reset_environment()267 sasmodels.sasview_model.reset_environment() 268 268 269 269 try:
Note: See TracChangeset
for help on using the changeset viewer.