Changeset ee563d5 in sasview for src/sas


Ignore:
Timestamp:
Oct 7, 2016 9:11:15 AM (8 years ago)
Author:
Mathieu Doucet <doucetm@…>
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, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
61780e3
Parents:
9b6d62d (diff), 5dd7499 (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 'master' of https://github.com/SasView/sasview

Location:
src/sas/sasgui
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/calculator/media/image_viewer_help.rst

    rd85c194 rda456fb  
    33.. This is a port of the original SasView html help file to ReSTructured text 
    44.. by S King, ISIS, during SasView CodeCamp-III in Feb 2015. 
     5 
     6.. _Image_Viewer_Tool: 
    57 
    68Image Viewer Tool 
  • src/sas/sasgui/perspectives/calculator/media/sas_calculator_help.rst

    r7805458 rda456fb  
    33.. This is a port of the original SasView html help file to ReSTructured text 
    44.. by S King, ISIS, during SasView CodeCamp-III in Feb 2015. 
     5 
     6.. _SANS_Calculator_Tool: 
    57 
    68Generic SANS Calculator Tool 
  • src/sas/sasgui/perspectives/calculator/pyconsole.py

    r7673ecd rf1cbae7  
    99import wx 
    1010from wx.lib.dialogs import ScrolledMessageDialog 
     11from wx.lib import layoutf 
     12 
    1113import wx.py.editor as editor 
    1214 
     
    6365        title, icon = "Info", wx.ICON_INFORMATION 
    6466    text = "\n".join(parts) 
    65     dlg = ScrolledMessageDialog(parent, text, title, size=((550, 250))) 
     67    dlg = ResizableScrolledMessageDialog(parent, text, title, size=((550, 250))) 
    6668    fnt = wx.Font(10, wx.TELETYPE, wx.NORMAL, wx.NORMAL) 
    6769    dlg.GetChildren()[0].SetFont(fnt) 
     
    7072    dlg.Destroy() 
    7173    return errmsg is None 
     74 
     75class ResizableScrolledMessageDialog(wx.Dialog): 
     76    """ 
     77    Custom version of wx ScrolledMessageDialog, allowing border resize 
     78    """ 
     79    def __init__(self, parent, msg, caption, 
     80        pos=wx.DefaultPosition, size=(500,300), 
     81        style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER ): 
     82        # Notice, that style can be overrriden in the caller. 
     83        wx.Dialog.__init__(self, parent, -1, caption, pos, size, style) 
     84        x, y = pos 
     85        if x == -1 and y == -1: 
     86            self.CenterOnScreen(wx.BOTH) 
     87 
     88        text = wx.TextCtrl(self, -1, msg, style=wx.TE_MULTILINE | wx.TE_READONLY) 
     89        ok = wx.Button(self, wx.ID_OK, "OK") 
     90 
     91        # Mysterious constraint layouts from  
     92        # https://www.wxpython.org/docs/api/wx.lib.layoutf.Layoutf-class.html 
     93        lc = layoutf.Layoutf('t=t5#1;b=t5#2;l=l5#1;r=r5#1', (self,ok)) 
     94        text.SetConstraints(lc) 
     95        lc = layoutf.Layoutf('b=b5#1;x%w50#1;w!80;h!25', (self,)) 
     96        ok.SetConstraints(lc) 
     97 
     98        self.SetAutoLayout(1) 
     99        self.Layout() 
    72100 
    73101class PyConsole(editor.EditorNotebookFrame): 
  • src/sas/sasgui/perspectives/corfunc/media/corfunc_help.rst

    rf56770ef rda456fb  
    11.. corfunc_help.rst 
     2 
     3.. _Correlation_Function_Analysis: 
    24 
    35Correlation Function Analysis 
  • src/sas/sasgui/perspectives/file_converter/media/file_converter_help.rst

    r97e90b7 rda456fb  
    11.. file_converter_help.rst 
     2 
     3.. _File_Converter_Tool: 
    24 
    35File Converter Tool 
  • src/sas/sasgui/perspectives/fitting/media/plugin.rst

    rcbbb6a4 rb2a3814  
    33Writing a Plugin Model 
    44====================== 
     5 
     6.. note:: If some code blocks are not readable, expand the documentation window 
    57 
    68Overview 
  • src/sas/sasgui/guiframe/dataFitting.py

    rd85c194 r9b6d62d  
    363363        _str = "%s\n" % LoadData2D.__str__(self) 
    364364        return _str  
    365      
    366     def _validity_check(self, other): 
    367         """ 
    368         Checks that the data lengths are compatible. 
    369         Checks that the x vectors are compatible. 
    370         Returns errors vectors equal to original 
    371         errors vectors if they were present or vectors 
    372         of zeros when none was found. 
    373          
    374         :param other: other data set for operation 
    375          
    376         :return: dy for self, dy for other [numpy arrays] 
    377          
    378         :raise ValueError: when lengths are not compatible 
    379          
    380         """ 
    381         err_other = None 
    382         if isinstance(other, Data2D): 
    383             # Check that data lengths are the same 
    384             if len(self.data) != len(other.data) or \ 
    385                 len(self.qx_data) != len(other.qx_data) or \ 
    386                 len(self.qy_data) != len(other.qy_data): 
    387                 msg = "Unable to perform operation: data length are not equal" 
    388                 raise ValueError, msg 
    389             #if len(self.data) < 1: 
    390             #    msg = "Incompatible data sets: I-values do not match" 
    391             #    raise ValueError, msg  
    392             for ind in range(len(self.data)): 
    393                 if self.qx_data[ind] != other.qx_data[ind]: 
    394                     msg = "Incompatible data sets: qx-values do not match" 
    395                     raise ValueError, msg 
    396                 if self.qy_data[ind] != other.qy_data[ind]: 
    397                     msg = "Incompatible data sets: qy-values do not match" 
    398                     raise ValueError, msg 
    399                     
    400             # Check that the scales match 
    401             err_other = other.err_data 
    402             if other.err_data == None or \ 
    403                 (len(other.err_data) != len(other.data)): 
    404                 err_other = numpy.zeros(len(other.data)) 
    405              
    406         # Check that we have errors, otherwise create zero vector 
    407         err = self.err_data 
    408         if self.err_data == None or \ 
    409             (len(self.err_data) != len(self.data)): 
    410             err = numpy.zeros(len(other.data)) 
    411              
    412         return err, err_other 
    413  
    414     def _validity_check_union(self, other): 
    415         """ 
    416         Checks that the data lengths are compatible. 
    417         Checks that the x vectors are compatible. 
    418         Returns errors vectors equal to original 
    419         errors vectors if they were present or vectors 
    420         of zeros when none was found. 
    421          
    422         :param other: other data set for operation 
    423          
    424         :return: bool 
    425          
    426         :raise ValueError: when data types are not compatible 
    427          
    428         """ 
    429         if not isinstance(other, Data2D): 
    430             msg = "Unable to perform operation: different types of data set" 
    431             raise ValueError, msg    
    432         return True 
    433      
     365 
    434366    def _perform_operation(self, other, operation): 
    435367        """ 
Note: See TracChangeset for help on using the changeset viewer.