Ignore:
Timestamp:
Jan 5, 2014 9:22:22 AM (8 years ago)
Author:
toby
Message:

fixup number formatting; update produced doc files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sphinxdocs/build/html/_modules/GSASIIgrid.html

    r1168 r1183  
    5454<span class="c">#GSASIIgrid - data display routines</span>
    5555<span class="c">########### SVN repository information ###################</span>
    56 <span class="c"># $Date: 2013-12-05 14:50:03 -0600 (Thu, 05 Dec 2013) $</span>
    57 <span class="c"># $Author: toby $</span>
    58 <span class="c"># $Revision: 1161 $</span>
     56<span class="c"># $Date: 2013-12-19 13:34:54 -0600 (Thu, 19 Dec 2013) $</span>
     57<span class="c"># $Author: vondreele $</span>
     58<span class="c"># $Revision: 1177 $</span>
    5959<span class="c"># $URL: https://subversion.xor.aps.anl.gov/pyGSAS/trunk/GSASIIgrid.py $</span>
    60 <span class="c"># $Id: GSASIIgrid.py 1161 2013-12-05 20:50:03Z toby $</span>
     60<span class="c"># $Id: GSASIIgrid.py 1177 2013-12-19 19:34:54Z vondreele $</span>
    6161<span class="c">########### SVN repository information ###################</span>
    6262<span class="sd">&#39;&#39;&#39;</span>
     
    8080<span class="kn">import</span> <span class="nn">webbrowser</span>     <span class="c"># could postpone this for quicker startup</span>
    8181<span class="kn">import</span> <span class="nn">GSASIIpath</span>
    82 <span class="n">GSASIIpath</span><span class="o">.</span><span class="n">SetVersionNumber</span><span class="p">(</span><span class="s">&quot;$Revision: 1161 $&quot;</span><span class="p">)</span>
     82<span class="n">GSASIIpath</span><span class="o">.</span><span class="n">SetVersionNumber</span><span class="p">(</span><span class="s">&quot;$Revision: 1177 $&quot;</span><span class="p">)</span>
    8383<span class="kn">import</span> <span class="nn">GSASIImath</span> <span class="kn">as</span> <span class="nn">G2mth</span>
    8484<span class="kn">import</span> <span class="nn">GSASIIIO</span> <span class="kn">as</span> <span class="nn">G2IO</span>
     
    227227<span class="sd">      type of int, float, str or unicode; the TextCrtl will be initialized</span>
    228228<span class="sd">      from this value.</span>
     229<span class="sd">      </span>
     230<span class="sd">    :param list [nDig,nPlc]: number of digits &amp; places after decimal to use</span>
     231<span class="sd">      for display of float (default=[10,2])</span>
    229232
    230233<span class="sd">    :param bool notBlank: if True (default) blank values are invalid</span>
     
    275278
    276279<span class="sd">    &#39;&#39;&#39;</span>
    277     <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">parent</span><span class="p">,</span><span class="n">loc</span><span class="p">,</span><span class="n">key</span><span class="p">,</span><span class="n">notBlank</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span><span class="nb">min</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span><span class="nb">max</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
     280    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">parent</span><span class="p">,</span><span class="n">loc</span><span class="p">,</span><span class="n">key</span><span class="p">,</span><span class="n">nDig</span><span class="o">=</span><span class="p">[</span><span class="mi">10</span><span class="p">,</span><span class="mi">2</span><span class="p">],</span><span class="n">notBlank</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span><span class="nb">min</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span><span class="nb">max</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
    278281                 <span class="n">OKcontrol</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span><span class="n">OnLeave</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span><span class="n">typeHint</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
    279282                 <span class="n">CIFinput</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kw</span><span class="p">):</span>
     
    281284        <span class="bp">self</span><span class="o">.</span><span class="n">result</span> <span class="o">=</span> <span class="n">loc</span>
    282285        <span class="bp">self</span><span class="o">.</span><span class="n">key</span> <span class="o">=</span> <span class="n">key</span>
     286        <span class="bp">self</span><span class="o">.</span><span class="n">nDig</span> <span class="o">=</span> <span class="n">nDig</span>
    283287        <span class="bp">self</span><span class="o">.</span><span class="n">OKcontrol</span><span class="o">=</span><span class="n">OKcontrol</span>
    284288        <span class="bp">self</span><span class="o">.</span><span class="n">OnLeave</span> <span class="o">=</span> <span class="n">OnLeave</span>
     
    366370                <span class="k">else</span><span class="p">:</span>
    367371                    <span class="bp">self</span><span class="o">.</span><span class="n">invalid</span> <span class="o">=</span> <span class="bp">True</span>
    368             <span class="n">wx</span><span class="o">.</span><span class="n">TextCtrl</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="nb">str</span><span class="p">(</span><span class="n">G2py3</span><span class="o">.</span><span class="n">FormatValue</span><span class="p">(</span><span class="n">val</span><span class="p">)))</span>
     372            <span class="n">wx</span><span class="o">.</span><span class="n">TextCtrl</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="nb">str</span><span class="p">(</span><span class="n">G2py3</span><span class="o">.</span><span class="n">FormatValue</span><span class="p">(</span><span class="n">val</span><span class="p">,</span><span class="bp">self</span><span class="o">.</span><span class="n">nDig</span><span class="p">)))</span>
    369373        <span class="k">else</span><span class="p">:</span>
    370374            <span class="n">wx</span><span class="o">.</span><span class="n">TextCtrl</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="nb">str</span><span class="p">(</span><span class="n">val</span><span class="p">))</span>
     
    14881492                 <span class="n">size</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">header</span><span class="o">=</span><span class="s">&#39;Item Selector&#39;</span><span class="p">,</span>
    14891493                 <span class="n">useCancel</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span><span class="n">multiple</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
    1490         <span class="sd">&#39;&#39;&#39; Provide a wx dialog to select a single item from list of choices</span>
    1491 
    1492 <span class="sd">        :param list ChoiceList: a list of choices where one will be selected</span>
    1493 <span class="sd">        :param wx.Frame ParentFrame: Name of parent frame (default None)</span>
    1494 <span class="sd">        :param str title: heading above list of choices (default &#39;Select an item&#39;)</span>
    1495 <span class="sd">        :param wx.Size size: Size for dialog to be created (default None -- size as needed)</span>
    1496 <span class="sd">        :param str header: Title to place on window frame (default &#39;Item Selector&#39;)</span>
    1497 <span class="sd">        :param bool useCancel: If True (default) both the OK and Cancel buttons are offered</span>
    1498 <span class="sd">        :param bool multiple: If True then multiple items can be selected (default False)</span>
    1499 
    1500 <span class="sd">        :returns: the selection index or None or a selection list if multiple is true</span>
    1501 <span class="sd">        &#39;&#39;&#39;</span>
     1494    <span class="sd">&#39;&#39;&#39; Provide a wx dialog to select a single item or multiple items from list of choices</span>
     1495
     1496<span class="sd">    :param list ChoiceList: a list of choices where one will be selected</span>
     1497<span class="sd">    :param wx.Frame ParentFrame: Name of parent frame (default None)</span>
     1498<span class="sd">    :param str title: heading above list of choices (default &#39;Select an item&#39;)</span>
     1499<span class="sd">    :param wx.Size size: Size for dialog to be created (default None -- size as needed)</span>
     1500<span class="sd">    :param str header: Title to place on window frame (default &#39;Item Selector&#39;)</span>
     1501<span class="sd">    :param bool useCancel: If True (default) both the OK and Cancel buttons are offered</span>
     1502<span class="sd">    :param bool multiple: If True then multiple items can be selected (default False)</span>
     1503<span class="sd">    </span>
     1504<span class="sd">    :returns: the selection index or None or a selection list if multiple is true</span>
     1505<span class="sd">    &#39;&#39;&#39;</span>
     1506    <span class="k">if</span> <span class="n">multiple</span><span class="p">:</span>
     1507        <span class="k">if</span> <span class="n">useCancel</span><span class="p">:</span>
     1508            <span class="n">dlg</span> <span class="o">=</span> <span class="n">G2MultiChoiceDialog</span><span class="p">(</span>
     1509                <span class="n">ParentFrame</span><span class="p">,</span><span class="n">title</span><span class="p">,</span> <span class="n">header</span><span class="p">,</span> <span class="n">ChoiceList</span><span class="p">)</span>
     1510        <span class="k">else</span><span class="p">:</span>
     1511            <span class="n">dlg</span> <span class="o">=</span> <span class="n">G2MultiChoiceDialog</span><span class="p">(</span>
     1512                <span class="n">ParentFrame</span><span class="p">,</span><span class="n">title</span><span class="p">,</span> <span class="n">header</span><span class="p">,</span> <span class="n">ChoiceList</span><span class="p">,</span>
     1513                <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">DEFAULT_DIALOG_STYLE</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">RESIZE_BORDER</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">OK</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">CENTRE</span><span class="p">)</span>
     1514    <span class="k">else</span><span class="p">:</span>
     1515        <span class="k">if</span> <span class="n">useCancel</span><span class="p">:</span>
     1516            <span class="n">dlg</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">SingleChoiceDialog</span><span class="p">(</span>
     1517                <span class="n">ParentFrame</span><span class="p">,</span><span class="n">title</span><span class="p">,</span> <span class="n">header</span><span class="p">,</span> <span class="n">ChoiceList</span><span class="p">)</span>
     1518        <span class="k">else</span><span class="p">:</span>
     1519            <span class="n">dlg</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">SingleChoiceDialog</span><span class="p">(</span>
     1520                <span class="n">ParentFrame</span><span class="p">,</span><span class="n">title</span><span class="p">,</span> <span class="n">header</span><span class="p">,</span><span class="n">ChoiceList</span><span class="p">,</span>
     1521                <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">DEFAULT_DIALOG_STYLE</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">RESIZE_BORDER</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">OK</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">CENTRE</span><span class="p">)</span>
     1522    <span class="k">if</span> <span class="n">size</span><span class="p">:</span> <span class="n">dlg</span><span class="o">.</span><span class="n">SetSize</span><span class="p">(</span><span class="n">size</span><span class="p">)</span>
     1523    <span class="k">if</span> <span class="n">dlg</span><span class="o">.</span><span class="n">ShowModal</span><span class="p">()</span> <span class="o">==</span> <span class="n">wx</span><span class="o">.</span><span class="n">ID_OK</span><span class="p">:</span>
    15021524        <span class="k">if</span> <span class="n">multiple</span><span class="p">:</span>
    1503             <span class="k">if</span> <span class="n">useCancel</span><span class="p">:</span>
    1504                 <span class="n">dlg</span> <span class="o">=</span> <span class="n">G2MultiChoiceDialog</span><span class="p">(</span>
    1505                     <span class="n">ParentFrame</span><span class="p">,</span><span class="n">title</span><span class="p">,</span> <span class="n">header</span><span class="p">,</span> <span class="n">ChoiceList</span><span class="p">)</span>
    1506             <span class="k">else</span><span class="p">:</span>
    1507                 <span class="n">dlg</span> <span class="o">=</span> <span class="n">G2MultiChoiceDialog</span><span class="p">(</span>
    1508                     <span class="n">ParentFrame</span><span class="p">,</span><span class="n">title</span><span class="p">,</span> <span class="n">header</span><span class="p">,</span> <span class="n">ChoiceList</span><span class="p">,</span>
    1509                     <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">DEFAULT_DIALOG_STYLE</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">RESIZE_BORDER</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">OK</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">CENTRE</span><span class="p">)</span>
    1510         <span class="k">else</span><span class="p">:</span>
    1511             <span class="k">if</span> <span class="n">useCancel</span><span class="p">:</span>
    1512                 <span class="n">dlg</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">SingleChoiceDialog</span><span class="p">(</span>
    1513                     <span class="n">ParentFrame</span><span class="p">,</span><span class="n">title</span><span class="p">,</span> <span class="n">header</span><span class="p">,</span> <span class="n">ChoiceList</span><span class="p">)</span>
    1514             <span class="k">else</span><span class="p">:</span>
    1515                 <span class="n">dlg</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">SingleChoiceDialog</span><span class="p">(</span>
    1516                     <span class="n">ParentFrame</span><span class="p">,</span><span class="n">title</span><span class="p">,</span> <span class="n">header</span><span class="p">,</span><span class="n">ChoiceList</span><span class="p">,</span>
    1517                     <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">DEFAULT_DIALOG_STYLE</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">RESIZE_BORDER</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">OK</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">CENTRE</span><span class="p">)</span>
    1518         <span class="k">if</span> <span class="n">size</span><span class="p">:</span> <span class="n">dlg</span><span class="o">.</span><span class="n">SetSize</span><span class="p">(</span><span class="n">size</span><span class="p">)</span>
    1519         <span class="k">if</span> <span class="n">dlg</span><span class="o">.</span><span class="n">ShowModal</span><span class="p">()</span> <span class="o">==</span> <span class="n">wx</span><span class="o">.</span><span class="n">ID_OK</span><span class="p">:</span>
    1520             <span class="k">if</span> <span class="n">multiple</span><span class="p">:</span>
    1521                 <span class="n">dlg</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span>
    1522                 <span class="k">return</span> <span class="n">dlg</span><span class="o">.</span><span class="n">GetSelections</span><span class="p">()</span>
    1523             <span class="k">else</span><span class="p">:</span>
    1524                 <span class="n">dlg</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span>
    1525                 <span class="k">return</span> <span class="n">dlg</span><span class="o">.</span><span class="n">GetSelection</span><span class="p">()</span>
     1525            <span class="n">dlg</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span>
     1526            <span class="k">return</span> <span class="n">dlg</span><span class="o">.</span><span class="n">GetSelections</span><span class="p">()</span>
    15261527        <span class="k">else</span><span class="p">:</span>
    15271528            <span class="n">dlg</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span>
    1528             <span class="k">return</span> <span class="bp">None</span>
     1529            <span class="k">return</span> <span class="n">dlg</span><span class="o">.</span><span class="n">GetSelection</span><span class="p">()</span>
     1530    <span class="k">else</span><span class="p">:</span>
    15291531        <span class="n">dlg</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span>
     1532        <span class="k">return</span> <span class="bp">None</span>
     1533    <span class="n">dlg</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span>
    15301534
    15311535<span class="c">################################################################################</span></div>
     
    25262530        <span class="bp">self</span><span class="o">.</span><span class="n">DataEdit</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="o">=</span><span class="n">wxID_HKLFADD</span><span class="p">,</span> <span class="n">kind</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ITEM_NORMAL</span><span class="p">,</span><span class="n">text</span><span class="o">=</span><span class="s">&#39;Add single crystal histograms&#39;</span><span class="p">,</span>
    25272531            <span class="n">help</span><span class="o">=</span><span class="s">&#39;Select new single crystal histograms to be used for this phase&#39;</span><span class="p">)</span>
    2528         <span class="bp">self</span><span class="o">.</span><span class="n">DataEdit</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="o">=</span><span class="n">wxID_DATADELETE</span><span class="p">,</span> <span class="n">kind</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ITEM_NORMAL</span><span class="p">,</span><span class="n">text</span><span class="o">=</span><span class="s">&#39;Delete histograms&#39;</span><span class="p">,</span>
    2529             <span class="n">help</span><span class="o">=</span><span class="s">&#39;Delete histograms from use for this phase&#39;</span><span class="p">)</span>
     2532        <span class="bp">self</span><span class="o">.</span><span class="n">DataEdit</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="o">=</span><span class="n">wxID_DATADELETE</span><span class="p">,</span> <span class="n">kind</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ITEM_NORMAL</span><span class="p">,</span><span class="n">text</span><span class="o">=</span><span class="s">&#39;Remove histograms&#39;</span><span class="p">,</span>
     2533            <span class="n">help</span><span class="o">=</span><span class="s">&#39;Remove histograms from use for this phase&#39;</span><span class="p">)</span>
    25302534        <span class="bp">self</span><span class="o">.</span><span class="n">PostfillDataMenu</span><span class="p">()</span>
    25312535           
Note: See TracChangeset for help on using the changeset viewer.