- Timestamp:
- Aug 13, 2018 3:47:15 PM (6 years ago)
- Branches:
- master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, unittest-saveload
- Children:
- ec52ea1
- Parents:
- fde3042 (diff), e2663b7 (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:
- Paul Butler <butlerpd@…> (08/13/18 15:47:15)
- git-committer:
- GitHub <noreply@…> (08/13/18 15:47:15)
- Location:
- src/sas
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/calculator/pyconsole.py
r4627657 re2663b7 28 28 Check that the model on the path can run. 29 29 """ 30 # TODO: fix model caching 31 # model_test.run_one() is directly forcing a reload of the module, but 32 # sasview_model is caching models that have already been loaded. 33 # If the sasview load happens before the test, then the module is 34 # reloaded out from under it, which causes the global variables in 35 # the model function definitions to be cleared (at least in python 2.7). 36 # To fix the proximal problem of models failing on test, perform the 37 # run_one() tests first. To fix the deeper problem we should either 38 # remove caching from sasmodels.sasview_model.load_custom_model() or 39 # add caching to sasmodels.custom.load_custom_kernel_module(). Another 40 # option is to add a runTests method to SasviewModel which runs the 41 # test suite directly from the model info structure. Probably some 42 # combination of options: 43 # (1) have this function (check_model) operate on a loaded model 44 # so that caching isn't needed in sasview_models.load_custom_model 45 # (2) add the runTests method to SasviewModel so that tests can 46 # be run on a loaded module. 47 # 48 # Also, note that the model test suite runs the equivalent of the 49 # "try running the model" block below, and doesn't need to be run 50 # twice. The reason for duplicating the block here is to generate 51 # an exception that show_model_output can catch. Need to write the 52 # runTests method so that it returns success flag as well as output 53 # string so that the extra test is not necessary. 54 55 # check the model's unit tests run 56 from sasmodels.model_test import run_one 57 result = run_one(path) 58 59 # remove cached version of the model, if any 60 from sasmodels import sasview_model 61 sasview_model.MODEL_BY_PATH.pop(path, None) 62 30 63 # try running the model 31 from sasmodels.sasview_model import load_custom_model 32 Model = load_custom_model(path) 64 Model = sasview_model.load_custom_model(path) 33 65 model = Model() 34 66 q = np.array([0.01, 0.1]) … … 36 68 qx, qy = np.array([0.01, 0.01]), np.array([0.1, 0.1]) 37 69 Iqxy = model.evalDistribution([qx, qy]) 38 39 # check the model's unit tests run40 from sasmodels.model_test import run_one41 result = run_one(path)42 70 43 71 return result -
src/sas/sascalc/dataloader/readers/abs_reader.py
re3775c6 rbd5c3b1 171 171 172 172 try: 173 _x = float(toks[ 0])173 _x = float(toks[4]) 174 174 _y = float(toks[1]) 175 175 _dy = float(toks[2]) -
src/sas/sascalc/fit/pagestate.py
r3b070a0 r59873e1 13 13 ################################################################################ 14 14 import time 15 import re 15 16 import os 16 17 import sys … … 962 963 if node.get('version'): 963 964 # Get the version for model conversion purposes 964 self.version = tuple(int(e) for e in965 str.split(node.get('version'), "."))965 x = re.sub('[^\d.]', '', node.get('version')) 966 self.version = tuple(int(e) for e in str.split(x, ".")) 966 967 # The tuple must be at least 3 items long 967 968 while len(self.version) < 3: -
src/sas/sasgui/guiframe/local_perspectives/plotting/parameters_panel_slicer.py
ra26f67f ra20a255 251 251 self.bck.Add(self.batch_slicer_button, (iy, ix), (1, 1), 252 252 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 253 # Help button 254 255 self.bt_help = wx.Button(self, wx.NewId(), "HELP") 256 self.bt_help.SetToolTipString( 257 "Help for the slicer parameters and batch slicing.") 258 self.bck.Add(self.bt_help, (iy, 1), (1, 1), 259 wx.ALIGN_RIGHT | wx.ADJUST_MINSIZE, 15) 260 wx.EVT_BUTTON(self, self.bt_help.GetId(), self.on_help) 261 253 262 iy += 1 254 263 self.bck.Add((5, 5), (iy, ix), (1, 1), 255 264 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 5) 265 256 266 self.bck.Layout() 257 267 self.bck.Fit(self) … … 535 545 self.default_value += "_{0}".format(key).split(" [")[0] 536 546 self.default_value += "-{:.2f}".format(params[key]) 547 548 def on_help(self, event=None): 549 """ 550 Opens a help window for the slicer parameters/batch slicing window 551 :param event: 552 :return: 553 """ 554 from sas.sasgui.guiframe.documentation_window import DocumentationWindow 555 556 _TreeLocation = "user/sasgui/guiframe/graph_help.html" 557 _doc_viewer = DocumentationWindow(self, wx.ID_ANY, _TreeLocation, 558 "#d-data-averaging", 559 "Data Explorer Help") -
src/sas/sasgui/guiframe/media/graph_help.rst
r5ed76f8 rde68f78 266 266 267 267 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 268 .. _d_data_averaging: 268 269 269 270 2D data averaging … … 301 302 Alternatively, once a 'slicer' is active you can also select the region to 302 303 average by bringing back the *Dataset Menu* and selecting *Edit Slicer 303 Parameters*. A dialog window will appear in which you can enter values to 304 define a region or select the number of points to plot (*nbins*). 304 Parameters and Batch Fitting*. A dialog window will appear in which you can 305 enter values to define a region, select the number of points to plot (*nbins*), 306 or apply the slicer to any or all other 2D data plots. 305 307 306 308 A separate plot window will also have appeared, displaying the requested … … 315 317 316 318 To remove a 'slicer', bring back the *Dataset menu* and select *Clear Slicer*. 319 320 Batch Slicing 321 ^^^^^^^^^^^^^ 322 323 A slicer can be applied to any or all existing 2D data plots using the 'Slicer 324 Parameters' window. To open the window, select *Edit Slicer Parameters and Batch 325 Fitting* in the *Dataset Menu* (see Invoking_the_dataset_menu_). Batch slicing 326 options are available at the bottom of the window. 327 328 Select the 2D plots you want to apply the slicer to. All 2D plots are selected 329 by default. The resulting 1D data for all slicers can be saved as a text file 330 and then sent to fitting by selecting the *Auto save generated 1D* check box. 331 Sending data to the fitting perspective requires the data be saved. 332 333 Once the auto save check box is selected, you can select where the files are 334 saved. The file name for the saved data is the slicer name plus the file name 335 of the original data set, plus what is in the *Append to file name* field. The 336 default value in the append to field includes the names and values for all of 337 the slicer parameters. 338 339 The batch of slices can be sent to fitting if desired, with three options 340 available. The first is to not fit the data, the second is to send the 341 slices to individual fit pages, and the third is to send all sliced data to a 342 single batch fit window. 343 344 Clicking *Apply Slicer to Selected Plots* will create a slicer for each selected 345 plot with the parameters entered in the 'Slicer Parameters' window. Depending on 346 the options selected the data may then be saved, loaded as separate data sets in 347 the data manager panel, and finally sent to fitting. 317 348 318 349 Unmasked circular average
Note: See TracChangeset
for help on using the changeset viewer.