Changeset 3506


Ignore:
Timestamp:
Jul 25, 2018 12:12:20 AM (3 years ago)
Author:
svnjenkins
Message:

fix scriptable problem due to change in Restraints; update Tutorials; misc. fixes for Sphinx docs

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r3447 r3506  
    566566    return
    567567
    568 objectScanIgnore = [int,bool,float,str,np.float64,np.int32,np.int64,np.ndarray,G2obj.G2VarObj,ma.MaskedArray]
     568objectScanIgnore = [int,bool,float,str,np.float64,np.int32,np.int64,np.ndarray,G2obj.G2VarObj]
     569try:
     570    objectScanIgnore += [ma.MaskedArray] # fails in doc builds
     571except AttributeError:
     572    pass
     573   
    569574if '2' in platform.python_version_tuple()[0]:
    570575    objectScanIgnore += [unicode,long,]
  • trunk/GSASIIctrlGUI.py

    r3487 r3506  
    434434       is either 'f' (default) or 'g'. Alternately, None can be specified which
    435435       causes numbers to be displayed with approximately 5 significant figures
    436        for floats. If this is specified, then :obj:`typeHint`=float becomes the
     436       for floats. If this is specified, then :obj:`typeHint` = float becomes the
    437437       default.
    438438       (Default=None).
     
    28382838    :param int height: an optional height (pixels) for the table (defaults to 400)
    28392839   
    2840     Example use::
     2840    Example use::
     2841   
    28412842        lbls = ('col 1','col 2','col 3')
    28422843        choices=(['test1','explanation of test 1'],
  • trunk/GSASIIobj.py

    r3469 r3506  
    18991899    def ExtensionValidator(self, filename):
    19001900        '''This methods checks if the file has the correct extension
    1901         Return False if this filename will not be supported by this reader (only
    1902           when strictExtension is True)
    1903         Return True if the extension matches the list supplied by the reader
    1904         Return None if the reader allows un-registered extensions
     1901       
     1902        :returns:
     1903       
     1904          * False if this filename will not be supported by this reader (only
     1905            when strictExtension is True)
     1906          * True if the extension matches the list supplied by the reader
     1907          * None if the reader allows un-registered extensions
     1908         
    19051909        '''
    19061910        if filename:
  • trunk/GSASIIplot.py

    r3496 r3506  
    157157except ImportError:
    158158    from matplotlib.backends.backend_agg import FigureCanvas as hcCanvas # standard name
     159except RuntimeError:  # happens during doc builds
     160    pass
    159161
    160162# useful degree trig functions
     
    256258        Add a set of subplots to this figure.
    257259       
    258         Parameters
    259         ----------
    260         nrows, ncols : int, default: 1
     260        :param nrows, ncols : int, default: 1
    261261            Number of rows/cols of the subplot grid.
    262         sharex, sharey : bool or {'none', 'all', 'row', 'col'}, default: False
     262        :param sharex, sharey : bool or {'none', 'all', 'row', 'col'}, default: False
    263263            Controls sharing of properties among x (`sharex`) or y (`sharey`)
    264264            axes:
     265           
    265266                - True or 'all': x- or y-axis will be shared among all
    266267                  subplots.
     
    269270                - 'row': each subplot row will share an x- or y-axis.
    270271                - 'col': each subplot column will share an x- or y-axis.
     272               
    271273            When subplots have a shared x-axis along a column, only the x tick
    272274            labels of the bottom subplot are visible.  Similarly, when
    273275            subplots have a shared y-axis along a row, only the y tick labels
    274276            of the first column subplot are visible.
    275         squeeze : bool, default: True
     277        :param squeeze : bool, default: True
    276278            - If True, extra dimensions are squeezed out from the returned
    277279              axis object:
     280             
    278281                - if only one subplot is constructed (nrows=ncols=1), the
    279282                  resulting single Axes object is returned as a scalar.
     
    283286                - for NxM, subplots with N>1 and M>1 are returned as a 2D
    284287                  arrays.
     288                 
    285289            - If False, no squeezing at all is done: the returned Axes object
    286290              is always a 2D array containing Axes instances, even if it ends
    287291              up being 1x1.
    288         subplot_kw : dict, default: {}
     292             
     293        :param subplot_kw : dict, default: {}
    289294            Dict with keywords passed to the
    290295            :meth:`~matplotlib.figure.Figure.add_subplot` call used to create
    291296            each subplots.
    292         gridspec_kw : dict, default: {}
     297        :param gridspec_kw : dict, default: {}
    293298            Dict with keywords passed to the
    294299            :class:`~matplotlib.gridspec.GridSpec` constructor used to create
    295300            the grid the subplots are placed on.
    296         Returns
    297         -------
    298         ax : single Axes object or array of Axes objects
     301           
     302        :return: ax : single Axes object or array of Axes objects
    299303            The added axes.  The dimensions of the resulting array can be
    300304            controlled with the squeeze keyword, see above.
    301         See Also
    302         --------
    303         pyplot.subplots : pyplot API; docstring includes examples.
     305           
     306        See Also pyplot.subplots : pyplot API; docstring includes examples.
     307       
    304308        """
    305309
  • trunk/GSASIIscriptable.py

    r3504 r3506  
    12011201    Represents an entire GSAS-II project.
    12021202
    1203     There are two ways to initialize it:
     1203    :param str gpxfile: Existing .gpx file to be loaded. If nonexistent,
     1204            creates an empty project.
     1205    :param str author: Author's name (not yet implemented)
     1206    :param str newgpx: The filename the project should be saved to in
     1207            the future. If both newgpx and gpxfile are present, the project is
     1208            loaded from the gpxfile, then when saved will be written to newgpx.
     1209    :param str filename: Name to be used to save the project. Has same function as
     1210            parameter newgpx (do not use both gpxfile and filename). Use of newgpx
     1211            is preferred over filename.
     1212
     1213    There are two ways to initialize this object:
    12041214
    12051215    >>> # Load an existing project file
     
    12371247    """
    12381248    def __init__(self, gpxfile=None, author=None, filename=None, newgpx=None):
    1239         """Loads a GSAS-II project from a specified filename.
    1240 
    1241         :param str gpxfile: Existing .gpx file to be loaded. If nonexistent,
    1242             creates an empty project.
    1243         :param str author: Author's name (not yet implemented)
    1244         :param str newgpx: The filename the project should be saved to in
    1245             the future. If both newgpx and gpxfile are present, the project is
    1246             loaded from the gpxfile, then when saved will be written to newgpx.
    1247         :param str filename: Name to be used to save the project. Has same function as
    1248             parameter newgpx (do not use both gpxfile and filename). Use of newgpx
    1249             is preferred over filename.
    1250         """
    12511249        if filename is not None and newgpx is not None:
    12521250            raise G2ScriptException('Do not use filename and newgpx together')
     
    15921590            """
    15931591        output = []
     1592        # loop through each tree entry. If it is more than one level (more than one item in the
     1593        # list of names) then it must be a histogram, unless labeled Phases or Restraints
    15941594        for obj in self.names:
    1595             if len(obj) > 1 and obj[0] != u'Phases':
     1595            if len(obj) > 1 and obj[0] != u'Phases' and obj[0] != u'Restraints':
    15961596                output.append(self.histogram(obj[0]))
    15971597        return output
     
    23462346    def set_peakFlags(self,peaklist=None,area=None,pos=None,sig=None,gam=None):
    23472347        '''Set refinement flags for peaks
     2348       
    23482349        :param list peaklist: a list of peaks to change flags. If None (default), changes
    23492350          are made to all peaks.
     
    33113312
    33123313if __name__ == '__main__':
     3314    #fname='/tmp/corundum-template.gpx'
     3315    #prj = G2Project(fname)
    33133316    main()
  • trunk/help/Tutorials.html

    r3417 r3506  
    1515 [No exercise files].
    1616<blockquote><I>An introduction to GSAS-II with starting instructions and a brief description of the displays.</I></blockquote>
    17 <LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/BkgFit/FitBkgTut.htm">Fitting the Starting Background using Fixed Points</A>
    18  [link: <A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/BkgFit/data">Exercise files</A>].
    19 <blockquote><I>This shows how to get an initial estimate of background parameters from a suite of fixed points
    20      before beginning Rietveld refinement.</I></blockquote>
    2117</UL><h4>Rietveld refinement</H4><UL>
    2218<LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/CWNeutron/Neutron CW Powder Data.htm">CW Neutron Powder fit for Yttrium-Iron Garnet</A>
     
    3329 [link: <A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/TOF-CW Joint Refinement/data">Exercise files</A>].
    3430<blockquote><I>This shows Rietveld refinement with high resolution synchrotron powder data and neutron TOF data</I></blockquote>
     31<LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SimpleMagnetic/Simple Magnetic.htm">Simple Magnetic Structure Analysis</A>
     32 [link: <A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SimpleMagnetic/data">Exercise files</A>].
     33<blockquote><I>Analysis of a simple antiferromagnet and a simple ferromagnet from CW neutron powder data</I></blockquote>
    3534<LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/Simulation/SimTutorial.htm">Simulating Powder Diffraction with GSAS-II</A>
    3635 [link: <A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/Simulation/data">Exercise files</A>].
    3736<blockquote><I>This show how to create a simulated powder pattern from a lab diffractometer.</I></blockquote>
     37<LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/BkgFit/FitBkgTut.htm">Fitting the Starting Background using Fixed Points</A>
     38 [link: <A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/BkgFit/data">Exercise files</A>].
     39<blockquote><I>This shows how to get an initial estimate of background parameters from a suite of fixed points
     40     before beginning Rietveld refinement.</I></blockquote>
    3841</UL><h4>Parametric sequential fitting</H4><UL>
    3942<LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SeqRefine/SequentialTutorial.htm">Sequential refinement of multiple datasets</A>
     
    4548<blockquote><I>This explores the results of the sequential refinement obtained in the previous tutorial; includes
    4649     plotting of variables and fitting the changes with simple equations.</I></blockquote>
     50</UL>
     51<UL><LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/TOF Sequential Single Peak Fit/TOF Sequential Single Peak Fit.htm">Sequential fitting of single peaks and strain analysis of reult</A> <A href="#prereq">*</A>
     52 [link: <A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/TOF Sequential Single Peak Fit/data">Exercise files</A>].
     53<blockquote><I>This shows the fitting of single peaks in a sequence of TOF powder patterns from a sample under load; includes
     54      fitting of the result to get Hookes Law coefficients for elastic deformations.</I></blockquote>
    4755</UL>
    4856</UL><h4>Structure solution</H4><UL>
Note: See TracChangeset for help on using the changeset viewer.