Changeset 9a5097c in sasview for src/sas/sasgui/perspectives/fitting
- Timestamp:
- Mar 26, 2017 11:33:16 PM (8 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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- ed2276f
- Parents:
- 9146ed9
- Location:
- src/sas/sasgui/perspectives/fitting
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/basepage.py
rb301db9 r9a5097c 5 5 import os 6 6 import wx 7 import numpy 7 import numpy as np 8 8 import time 9 9 import copy … … 100 100 self.graph_id = None 101 101 # Q range for data set 102 self.qmin_data_set = n umpy.inf102 self.qmin_data_set = np.inf 103 103 self.qmax_data_set = None 104 104 self.npts_data_set = 0 … … 278 278 279 279 """ 280 x = n umpy.linspace(start=self.qmin_x, stop=self.qmax_x,280 x = np.linspace(start=self.qmin_x, stop=self.qmax_x, 281 281 num=self.npts_x, endpoint=True) 282 282 self.data = Data1D(x=x) … … 295 295 """ 296 296 if self.qmin_x >= 1.e-10: 297 qmin = n umpy.log10(self.qmin_x)297 qmin = np.log10(self.qmin_x) 298 298 else: 299 299 qmin = -10. 300 300 301 301 if self.qmax_x <= 1.e10: 302 qmax = n umpy.log10(self.qmax_x)302 qmax = np.log10(self.qmax_x) 303 303 else: 304 304 qmax = 10. 305 305 306 x = n umpy.logspace(start=qmin, stop=qmax,306 x = np.logspace(start=qmin, stop=qmax, 307 307 num=self.npts_x, endpoint=True, base=10.0) 308 308 self.data = Data1D(x=x) … … 341 341 qstep = self.npts_x 342 342 343 x = n umpy.linspace(start=xmin, stop=xmax, num=qstep, endpoint=True)344 y = n umpy.linspace(start=ymin, stop=ymax, num=qstep, endpoint=True)343 x = np.linspace(start=xmin, stop=xmax, num=qstep, endpoint=True) 344 y = np.linspace(start=ymin, stop=ymax, num=qstep, endpoint=True) 345 345 # use data info instead 346 new_x = n umpy.tile(x, (len(y), 1))347 new_y = n umpy.tile(y, (len(x), 1))346 new_x = np.tile(x, (len(y), 1)) 347 new_y = np.tile(y, (len(x), 1)) 348 348 new_y = new_y.swapaxes(0, 1) 349 349 # all data reuire now in 1d array 350 350 qx_data = new_x.flatten() 351 351 qy_data = new_y.flatten() 352 q_data = n umpy.sqrt(qx_data * qx_data + qy_data * qy_data)352 q_data = np.sqrt(qx_data * qx_data + qy_data * qy_data) 353 353 # set all True (standing for unmasked) as default 354 mask = n umpy.ones(len(qx_data), dtype=bool)354 mask = np.ones(len(qx_data), dtype=bool) 355 355 # store x and y bin centers in q space 356 356 x_bins = x … … 358 358 359 359 self.data.source = Source() 360 self.data.data = n umpy.ones(len(mask))361 self.data.err_data = n umpy.ones(len(mask))360 self.data.data = np.ones(len(mask)) 361 self.data.err_data = np.ones(len(mask)) 362 362 self.data.qx_data = qx_data 363 363 self.data.qy_data = qy_data … … 783 783 # Skip non-data lines 784 784 logging.error(traceback.format_exc()) 785 return n umpy.array(angles), numpy.array(weights)785 return np.array(angles), np.array(weights) 786 786 except: 787 787 raise … … 2120 2120 for data in self.data_list: 2121 2121 # q value from qx and qy 2122 radius = n umpy.sqrt(data.qx_data * data.qx_data +2122 radius = np.sqrt(data.qx_data * data.qx_data + 2123 2123 data.qy_data * data.qy_data) 2124 2124 # get unmasked index … … 2126 2126 (radius <= float(self.qmax.GetValue())) 2127 2127 index_data = (index_data) & (data.mask) 2128 index_data = (index_data) & (n umpy.isfinite(data.data))2128 index_data = (index_data) & (np.isfinite(data.data)) 2129 2129 2130 2130 if len(index_data[index_data]) < 10: … … 2161 2161 index_data = (float(self.qmin.GetValue()) <= radius) & \ 2162 2162 (radius <= float(self.qmax.GetValue())) 2163 index_data = (index_data) & (n umpy.isfinite(data.y))2163 index_data = (index_data) & (np.isfinite(data.y)) 2164 2164 2165 2165 if len(index_data[index_data]) < 5: … … 2233 2233 2234 2234 # Check that min is less than max 2235 low = -n umpy.inf if min_str == "" else float(min_str)2236 high = n umpy.inf if max_str == "" else float(max_str)2235 low = -np.inf if min_str == "" else float(min_str) 2236 high = np.inf if max_str == "" else float(max_str) 2237 2237 if high < low: 2238 2238 min_ctrl.SetBackgroundColour("pink") … … 2654 2654 self.qmin_x = data_min 2655 2655 self.qmax_x = math.sqrt(x * x + y * y) 2656 # self.data.mask = n umpy.ones(len(self.data.data),dtype=bool)2656 # self.data.mask = np.ones(len(self.data.data),dtype=bool) 2657 2657 # check smearing 2658 2658 if not self.disable_smearer.GetValue(): … … 3366 3366 3367 3367 if value[1] == 'array': 3368 pd_vals = n umpy.array(value[2])3369 pd_weights = n umpy.array(value[3])3368 pd_vals = np.array(value[2]) 3369 pd_weights = np.array(value[3]) 3370 3370 if len(pd_vals) == 0 or len(pd_vals) != len(pd_weights): 3371 3371 msg = ("bad array distribution parameters for %s" -
src/sas/sasgui/perspectives/fitting/fitpage.py
rd85f1d8a r9a5097c 6 6 import wx 7 7 import wx.lib.newevent 8 import numpy 8 import numpy as np 9 9 import copy 10 10 import math … … 1115 1115 if item.GetValue(): 1116 1116 if button_list.index(item) == 0: 1117 flag = 0 # dy = n umpy.ones_like(dy_data)1117 flag = 0 # dy = np.ones_like(dy_data) 1118 1118 elif button_list.index(item) == 1: 1119 1119 flag = 1 # dy = dy_data 1120 1120 elif button_list.index(item) == 2: 1121 flag = 2 # dy = n umpy.sqrt(numpy.abs(data))1121 flag = 2 # dy = np.sqrt(np.abs(data)) 1122 1122 elif button_list.index(item) == 3: 1123 flag = 3 # dy = n umpy.abs(data)1123 flag = 3 # dy = np.abs(data) 1124 1124 break 1125 1125 return flag … … 1422 1422 key = event.GetKeyCode() 1423 1423 length = len(self.data.x) 1424 indx = (n umpy.abs(self.data.x - x_data)).argmin()1424 indx = (np.abs(self.data.x - x_data)).argmin() 1425 1425 # return array.flat[idx] 1426 1426 if key == wx.WXK_PAGEUP or key == wx.WXK_NUMPAD_PAGEUP: … … 1477 1477 self.enable2D: 1478 1478 # set mask 1479 radius = n umpy.sqrt(self.data.qx_data * self.data.qx_data +1479 radius = np.sqrt(self.data.qx_data * self.data.qx_data + 1480 1480 self.data.qy_data * self.data.qy_data) 1481 1481 index_data = ((self.qmin_x <= radius) & (radius <= self.qmax_x)) 1482 1482 index_data = (index_data) & (self.data.mask) 1483 index_data = (index_data) & (n umpy.isfinite(self.data.data))1483 index_data = (index_data) & (np.isfinite(self.data.data)) 1484 1484 if len(index_data[index_data]) < 10: 1485 1485 msg = "Cannot Plot :No or too little npts in" … … 1598 1598 and data.dqx_data.any() != 0: 1599 1599 self.smear_type = "Pinhole2d" 1600 self.dq_l = format_number(n umpy.average(data.dqx_data))1601 self.dq_r = format_number(n umpy.average(data.dqy_data))1600 self.dq_l = format_number(np.average(data.dqx_data)) 1601 self.dq_r = format_number(np.average(data.dqy_data)) 1602 1602 return 1603 1603 else: 1604 1604 return 1605 1605 # check if it is pinhole smear and get min max if it is. 1606 if data.dx is not None and n umpy.any(data.dx):1606 if data.dx is not None and np.any(data.dx): 1607 1607 self.smear_type = "Pinhole" 1608 1608 self.dq_l = data.dx[0] … … 1612 1612 elif data.dxl is not None or data.dxw is not None: 1613 1613 self.smear_type = "Slit" 1614 if data.dxl is not None and n umpy.all(data.dxl, 0):1614 if data.dxl is not None and np.all(data.dxl, 0): 1615 1615 self.dq_l = data.dxl[0] 1616 if data.dxw is not None and n umpy.all(data.dxw, 0):1616 if data.dxw is not None and np.all(data.dxw, 0): 1617 1617 self.dq_r = data.dxw[0] 1618 1618 # return self.smear_type,self.dq_l,self.dq_r … … 1921 1921 self.default_mask = copy.deepcopy(self.data.mask) 1922 1922 if self.data.err_data is not None \ 1923 and n umpy.any(self.data.err_data):1923 and np.any(self.data.err_data): 1924 1924 di_flag = True 1925 1925 if self.data.dqx_data is not None \ 1926 and n umpy.any(self.data.dqx_data):1926 and np.any(self.data.dqx_data): 1927 1927 dq_flag = True 1928 1928 else: 1929 1929 self.slit_smearer.Enable(True) 1930 1930 self.pinhole_smearer.Enable(True) 1931 if self.data.dy is not None and n umpy.any(self.data.dy):1931 if self.data.dy is not None and np.any(self.data.dy): 1932 1932 di_flag = True 1933 if self.data.dx is not None and n umpy.any(self.data.dx):1933 if self.data.dx is not None and np.any(self.data.dx): 1934 1934 dq_flag = True 1935 elif self.data.dxl is not None and n umpy.any(self.data.dxl):1935 elif self.data.dxl is not None and np.any(self.data.dxl): 1936 1936 dq_flag = True 1937 1937 … … 2067 2067 if self.data.__class__.__name__ == "Data2D" or \ 2068 2068 self.enable2D: 2069 radius = n umpy.sqrt(self.data.qx_data * self.data.qx_data +2069 radius = np.sqrt(self.data.qx_data * self.data.qx_data + 2070 2070 self.data.qy_data * self.data.qy_data) 2071 2071 index_data = (self.qmin_x <= radius) & (radius <= self.qmax_x) 2072 2072 index_data = (index_data) & (self.data.mask) 2073 index_data = (index_data) & (n umpy.isfinite(self.data.data))2073 index_data = (index_data) & (np.isfinite(self.data.data)) 2074 2074 npts2fit = len(self.data.data[index_data]) 2075 2075 else: … … 2104 2104 # make sure stop button to fit button all the time 2105 2105 self._on_fit_complete() 2106 if out is None or not n umpy.isfinite(chisqr):2106 if out is None or not np.isfinite(chisqr): 2107 2107 raise ValueError, "Fit error occured..." 2108 2108 … … 2115 2115 2116 2116 # Check if chi2 is finite 2117 if chisqr is not None and n umpy.isfinite(chisqr):2117 if chisqr is not None and np.isfinite(chisqr): 2118 2118 # format chi2 2119 2119 chi2 = format_number(chisqr, True) … … 2167 2167 2168 2168 if cov[ind] is not None: 2169 if n umpy.isfinite(float(cov[ind])):2169 if np.isfinite(float(cov[ind])): 2170 2170 val_err = format_number(cov[ind], True) 2171 2171 item[4].SetForegroundColour(wx.BLACK) … … 2291 2291 self.smear_type = 'Pinhole2d' 2292 2292 len_data = len(data.data) 2293 data.dqx_data = n umpy.zeros(len_data)2294 data.dqy_data = n umpy.zeros(len_data)2293 data.dqx_data = np.zeros(len_data) 2294 data.dqy_data = np.zeros(len_data) 2295 2295 else: 2296 2296 self.smear_type = 'Pinhole' 2297 2297 len_data = len(data.x) 2298 data.dx = n umpy.zeros(len_data)2298 data.dx = np.zeros(len_data) 2299 2299 data.dxl = None 2300 2300 data.dxw = None … … 2469 2469 try: 2470 2470 self.dxl = float(self.smear_slit_height.GetValue()) 2471 data.dxl = self.dxl * n umpy.ones(data_len)2471 data.dxl = self.dxl * np.ones(data_len) 2472 2472 self.smear_slit_height.SetBackgroundColour(wx.WHITE) 2473 2473 except: 2474 2474 self.dxl = None 2475 data.dxl = n umpy.zeros(data_len)2475 data.dxl = np.zeros(data_len) 2476 2476 if self.smear_slit_height.GetValue().lstrip().rstrip() != "": 2477 2477 self.smear_slit_height.SetBackgroundColour("pink") … … 2482 2482 self.dxw = float(self.smear_slit_width.GetValue()) 2483 2483 self.smear_slit_width.SetBackgroundColour(wx.WHITE) 2484 data.dxw = self.dxw * n umpy.ones(data_len)2484 data.dxw = self.dxw * np.ones(data_len) 2485 2485 except: 2486 2486 self.dxw = None 2487 data.dxw = n umpy.zeros(data_len)2487 data.dxw = np.zeros(data_len) 2488 2488 if self.smear_slit_width.GetValue().lstrip().rstrip() != "": 2489 2489 self.smear_slit_width.SetBackgroundColour("pink") … … 2612 2612 if event is None: 2613 2613 output = "-" 2614 elif not n umpy.isfinite(event.output):2614 elif not np.isfinite(event.output): 2615 2615 output = "-" 2616 2616 else: -
src/sas/sasgui/perspectives/fitting/fitting.py
rddbac66 r9a5097c 16 16 import wx 17 17 import logging 18 import numpy 18 import numpy as np 19 19 import time 20 20 from copy import deepcopy … … 1332 1332 new_theory = copy_data.data 1333 1333 new_theory[res.index] = res.theory 1334 new_theory[res.index == False] = n umpy.nan1334 new_theory[res.index == False] = np.nan 1335 1335 correct_result = True 1336 1336 #get all fittable parameters of the current model … … 1341 1341 param_list.remove(param) 1342 1342 if not correct_result or res.fitness is None or \ 1343 not n umpy.isfinite(res.fitness) or \1344 numpy.any(res.pvec == None) or not \1345 numpy.all(numpy.isfinite(res.pvec)):1343 not np.isfinite(res.fitness) or \ 1344 np.any(res.pvec == None) or not \ 1345 np.all(np.isfinite(res.pvec)): 1346 1346 data_name = str(None) 1347 1347 if data is not None: … … 1352 1352 msg += "Data %s and Model %s did not fit.\n" % (data_name, 1353 1353 model_name) 1354 ERROR = n umpy.NAN1354 ERROR = np.NAN 1355 1355 cell = BatchCell() 1356 1356 cell.label = res.fitness … … 1366 1366 batch_inputs["error on %s" % str(param)].append(ERROR) 1367 1367 else: 1368 # TODO: Why sometimes res.pvec comes with n umpy.float64?1368 # TODO: Why sometimes res.pvec comes with np.float64? 1369 1369 # probably from scipy lmfit 1370 if res.pvec.__class__ == n umpy.float64:1370 if res.pvec.__class__ == np.float64: 1371 1371 res.pvec = [res.pvec] 1372 1372 … … 1533 1533 fit_msg = res.mesg 1534 1534 if res.fitness is None or \ 1535 not n umpy.isfinite(res.fitness) or \1536 numpy.any(res.pvec == None) or \1537 not n umpy.all(numpy.isfinite(res.pvec)):1535 not np.isfinite(res.fitness) or \ 1536 np.any(res.pvec == None) or \ 1537 not np.all(np.isfinite(res.pvec)): 1538 1538 fit_msg += "\nFitting did not converge!!!" 1539 1539 wx.CallAfter(self._update_fit_button, page_id) 1540 1540 else: 1541 1541 #set the panel when fit result are float not list 1542 if res.pvec.__class__ == n umpy.float64:1542 if res.pvec.__class__ == np.float64: 1543 1543 pvec = [res.pvec] 1544 1544 else: 1545 1545 pvec = res.pvec 1546 if res.stderr.__class__ == n umpy.float64:1546 if res.stderr.__class__ == np.float64: 1547 1547 stderr = [res.stderr] 1548 1548 else: … … 1692 1692 if dy is None: 1693 1693 new_plot.is_data = False 1694 new_plot.dy = n umpy.zeros(len(y))1694 new_plot.dy = np.zeros(len(y)) 1695 1695 # If this is a theory curve, pick the proper symbol to make it a curve 1696 1696 new_plot.symbol = GUIFRAME_ID.CURVE_SYMBOL_NUM … … 1741 1741 """ 1742 1742 try: 1743 n umpy.nan_to_num(y)1743 np.nan_to_num(y) 1744 1744 new_plot = self.create_theory_1D(x, y, page_id, model, data, state, 1745 1745 data_description=model.name, … … 1826 1826 that can be plot. 1827 1827 """ 1828 n umpy.nan_to_num(image)1828 np.nan_to_num(image) 1829 1829 new_plot = Data2D(image=image, err_image=data.err_data) 1830 1830 new_plot.name = model.name + '2d' … … 2018 2018 if data_copy.__class__.__name__ == "Data2D": 2019 2019 if index == None: 2020 index = n umpy.ones(len(data_copy.data), dtype=bool)2020 index = np.ones(len(data_copy.data), dtype=bool) 2021 2021 if weight != None: 2022 2022 data_copy.err_data = weight 2023 2023 # get rid of zero error points 2024 2024 index = index & (data_copy.err_data != 0) 2025 index = index & (n umpy.isfinite(data_copy.data))2025 index = index & (np.isfinite(data_copy.data)) 2026 2026 fn = data_copy.data[index] 2027 2027 theory_data = self.page_finder[page_id].get_theory_data(fid=data_copy.id) … … 2033 2033 # 1 d theory from model_thread is only in the range of index 2034 2034 if index == None: 2035 index = n umpy.ones(len(data_copy.y), dtype=bool)2035 index = np.ones(len(data_copy.y), dtype=bool) 2036 2036 if weight != None: 2037 2037 data_copy.dy = weight 2038 2038 if data_copy.dy == None or data_copy.dy == []: 2039 dy = n umpy.ones(len(data_copy.y))2039 dy = np.ones(len(data_copy.y)) 2040 2040 else: 2041 2041 ## Set consistently w/AbstractFitengine: … … 2058 2058 return 2059 2059 2060 residuals = res[n umpy.isfinite(res)]2060 residuals = res[np.isfinite(res)] 2061 2061 # get chisqr only w/finite 2062 chisqr = n umpy.average(residuals * residuals)2062 chisqr = np.average(residuals * residuals) 2063 2063 2064 2064 self._plot_residuals(page_id=page_id, data=data_copy, … … 2097 2097 residuals.qy_data = data_copy.qy_data 2098 2098 residuals.q_data = data_copy.q_data 2099 residuals.err_data = n umpy.ones(len(residuals.data))2099 residuals.err_data = np.ones(len(residuals.data)) 2100 2100 residuals.xmin = min(residuals.qx_data) 2101 2101 residuals.xmax = max(residuals.qx_data) … … 2111 2111 # 1 d theory from model_thread is only in the range of index 2112 2112 if data_copy.dy == None or data_copy.dy == []: 2113 dy = n umpy.ones(len(data_copy.y))2113 dy = np.ones(len(data_copy.y)) 2114 2114 else: 2115 2115 if weight == None: 2116 dy = n umpy.ones(len(data_copy.y))2116 dy = np.ones(len(data_copy.y)) 2117 2117 ## Set consitently w/AbstractFitengine: 2118 2118 ## But this should be corrected later. … … 2133 2133 residuals.y = (fn - gn[index]) / en 2134 2134 residuals.x = data_copy.x[index] 2135 residuals.dy = n umpy.ones(len(residuals.y))2135 residuals.dy = np.ones(len(residuals.y)) 2136 2136 residuals.dx = None 2137 2137 residuals.dxl = None -
src/sas/sasgui/perspectives/fitting/model_thread.py
rc1c9929 r9a5097c 4 4 5 5 import time 6 import numpy 6 import numpy as np 7 7 import math 8 8 from sas.sascalc.data_util.calcthread import CalcThread … … 68 68 69 69 # Define matrix where data will be plotted 70 radius = n umpy.sqrt((self.data.qx_data * self.data.qx_data) + \70 radius = np.sqrt((self.data.qx_data * self.data.qx_data) + \ 71 71 (self.data.qy_data * self.data.qy_data)) 72 72 … … 75 75 index_model = (self.qmin <= radius) & (radius <= self.qmax) 76 76 index_model = index_model & self.data.mask 77 index_model = index_model & n umpy.isfinite(self.data.data)77 index_model = index_model & np.isfinite(self.data.data) 78 78 79 79 if self.smearer is not None: … … 91 91 self.data.qy_data[index_model] 92 92 ]) 93 output = n umpy.zeros(len(self.data.qx_data))93 output = np.zeros(len(self.data.qx_data)) 94 94 # output default is None 95 95 # This method is to distinguish between masked … … 163 163 """ 164 164 self.starttime = time.time() 165 output = n umpy.zeros((len(self.data.x)))165 output = np.zeros((len(self.data.x))) 166 166 index = (self.qmin <= self.data.x) & (self.data.x <= self.qmax) 167 167 … … 175 175 self.qmax) 176 176 mask = self.data.x[first_bin:last_bin+1] 177 unsmeared_output = n umpy.zeros((len(self.data.x)))177 unsmeared_output = np.zeros((len(self.data.x))) 178 178 unsmeared_output[first_bin:last_bin+1] = self.model.evalDistribution(mask) 179 179 self.smearer.model = self.model … … 183 183 # Check that the arrays are compatible. If we only have a model but no data, 184 184 # the length of data.y will be zero. 185 if isinstance(self.data.y, n umpy.ndarray) and output.shape == self.data.y.shape:186 unsmeared_data = n umpy.zeros((len(self.data.x)))187 unsmeared_error = n umpy.zeros((len(self.data.x)))185 if isinstance(self.data.y, np.ndarray) and output.shape == self.data.y.shape: 186 unsmeared_data = np.zeros((len(self.data.x))) 187 unsmeared_error = np.zeros((len(self.data.x))) 188 188 unsmeared_data[first_bin:last_bin+1] = self.data.y[first_bin:last_bin+1]\ 189 189 * unsmeared_output[first_bin:last_bin+1]\ … … 209 209 210 210 if p_model is not None and s_model is not None: 211 sq_values = n umpy.zeros((len(self.data.x)))212 pq_values = n umpy.zeros((len(self.data.x)))211 sq_values = np.zeros((len(self.data.x))) 212 pq_values = np.zeros((len(self.data.x))) 213 213 sq_values[index] = s_model.evalDistribution(self.data.x[index]) 214 214 pq_values[index] = p_model.evalDistribution(self.data.x[index]) -
src/sas/sasgui/perspectives/fitting/pagestate.py
rd5aff7f r9a5097c 18 18 import copy 19 19 import logging 20 import numpy 20 import numpy as np 21 21 import traceback 22 22 … … 410 410 for fittable, name, value, _, uncert, lower, upper, units in params: 411 411 if not value: 412 value = n umpy.nan412 value = np.nan 413 413 if not uncert or uncert[1] == '' or uncert[1] == 'None': 414 414 uncert[0] = False 415 uncert[1] = n umpy.nan415 uncert[1] = np.nan 416 416 if not upper or upper[1] == '' or upper[1] == 'None': 417 417 upper[0] = False 418 upper[1] = n umpy.nan418 upper[1] = np.nan 419 419 if not lower or lower[1] == '' or lower[1] == 'None': 420 420 lower[0] = False 421 lower[1] = n umpy.nan421 lower[1] = np.nan 422 422 if is_string: 423 423 p[name] = str(value) … … 449 449 lower = params.get(name + ".lower", '-inf') 450 450 units = params.get(name + ".units") 451 if std is not None and std is not n umpy.nan:451 if std is not None and std is not np.nan: 452 452 std = [True, str(std)] 453 453 else: 454 454 std = [False, ''] 455 if lower is not None and lower is not n umpy.nan:455 if lower is not None and lower is not np.nan: 456 456 lower = [True, str(lower)] 457 457 else: 458 458 lower = [True, '-inf'] 459 if upper is not None and upper is not n umpy.nan:459 if upper is not None and upper is not np.nan: 460 460 upper = [True, str(upper)] 461 461 else: … … 1100 1100 % (line, tagname, name)) 1101 1101 logging.error(msg + traceback.format_exc()) 1102 dic[name] = n umpy.array(value_list)1102 dic[name] = np.array(value_list) 1103 1103 setattr(self, varname, dic) 1104 1104 -
src/sas/sasgui/perspectives/fitting/utils.py
rd85c194 r9a5097c 2 2 Module contains functions frequently used in this package 3 3 """ 4 import numpy 4 import numpy as np 5 5 6 6 … … 19 19 data = data.y 20 20 if flag == 0: 21 weight = n umpy.ones_like(data)21 weight = np.ones_like(data) 22 22 elif flag == 1: 23 23 weight = dy_data 24 24 elif flag == 2: 25 weight = n umpy.sqrt(numpy.abs(data))25 weight = np.sqrt(np.abs(data)) 26 26 elif flag == 3: 27 weight = n umpy.abs(data)27 weight = np.abs(data) 28 28 return weight
Note: See TracChangeset
for help on using the changeset viewer.