Changeset 2967 for branch


Ignore:
Timestamp:
Aug 7, 2017 2:17:51 PM (4 years ago)
Author:
toby
Message:

misc changes for sphinx docs

Location:
branch/2frame
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branch/2frame/GSASII.py

    r2924 r2967  
    1010########### SVN repository information ###################
    1111'''
    12 *GSAS-II Main Module*
     12*GSAS-II GUI Script*
    1313=====================
    1414
    15 Main routines for the GSAS-II program
     15Script to start the GSAS-II graphical user interface. This script imports GSASIIpath,
     16sets a few misc. values and then launches :func:`GSASIIdataGUI.GSASIImain`, which
     17creates a wx.Application which in turns creates the GUI.
    1618'''
    1719
  • branch/2frame/GSASIIlattice.py

    r2802 r2967  
    418418    :returns: tuple of two 3x3 numpy arrays (A,B)
    419419
    420        * A for crystal to Cartesian transformations A*x = np.inner(A,x) = X
    421        * B (= inverse of A) for Cartesian to crystal transformation B*X = np.inner(B,X) = x
     420       * A for crystal to Cartesian transformations (A*x = np.inner(A,x) = X)
     421       * B (= inverse of A) for Cartesian to crystal transformation (B*X = np.inner(B,X) = x)
    422422
    423423    """
     
    12081208    :param str Laue: Laue symbol, as below
    12091209   
    1210       centrosymmetric Laue groups
    1211      
    1212          ::
     1210      centrosymmetric Laue groups::
    12131211       
    12141212            ['-1','2/m','112/m','2/m11','mmm','-42m','-4m2','4/mmm','-3',
    12151213            '-31m','-3m1','6/m','6/mmm','m3','m3m']
    12161214     
    1217       noncentrosymmetric Laue groups
    1218 
    1219          ::
     1215      noncentrosymmetric Laue groups::
    12201216     
    12211217           ['1','2','211','112','m','m11','11m','222','mm2','m2m','2mm',
  • branch/2frame/GSASIImath.py

    r2964 r2967  
    5555    *large* singular values.
    5656
    57     Parameters
    58     ----------
    59     a : (M, M) array_like - here assumed to be LS Hessian
     57    :param array a: (M, M) array_like - here assumed to be LS Hessian
    6058      Matrix to be pseudo-inverted.
    61     rcond : float
    62       Cutoff for small singular values.
     59    :param float rcond: Cutoff for small singular values.
    6360      Singular values smaller (in modulus) than
    6461      `rcond` * largest_singular_value (again, in modulus)
    6562      are set to zero.
    6663
    67     Returns
    68     -------
    69     B : (M, M) ndarray
     64    :returns: B : (M, M) ndarray
    7065      The pseudo-inverse of `a`
    7166
    72     Raises
    73     ------
    74     LinAlgError
     67    Raises: LinAlgError
    7568      If the SVD computation does not converge.
    7669
    77     Notes
    78     -----
    79     The pseudo-inverse of a matrix A, denoted :math:`A^+`, is
    80     defined as: "the matrix that 'solves' [the least-squares problem]
    81     :math:`Ax = b`," i.e., if :math:`\\bar{x}` is said solution, then
    82     :math:`A^+` is that matrix such that :math:`\\bar{x} = A^+b`.
     70    Notes:
     71      The pseudo-inverse of a matrix A, denoted :math:`A^+`, is
     72      defined as: "the matrix that 'solves' [the least-squares problem]
     73      :math:`Ax = b`," i.e., if :math:`\\bar{x}` is said solution, then
     74      :math:`A^+` is that matrix such that :math:`\\bar{x} = A^+b`.
    8375
    8476    It can be shown that if :math:`Q_1 \\Sigma Q_2^T = A` is the singular
     
    8981    zeros), and then :math:`\\Sigma^+` is simply the diagonal matrix
    9082    consisting of the reciprocals of A's singular values
    91     (again, followed by zeros). [1]_
    92 
    93     References
    94     ----------
     83    (again, followed by zeros). [1]
     84
     85    References:
    9586    .. [1] G. Strang, *Linear Algebra and Its Applications*, 2nd Ed., Orlando,
    9687           FL, Academic Press, Inc., 1980, pp. 139-142.
     
    39263917        i.e. find x0 such that func(x0) = T0.
    39273918
    3928         Parameters
    3929         ----------
    3930         best_state : _state
     3919        :param best_state: _state
    39313920            A _state object to store the function value and x0 found.
    39323921
    3933         returns
    3934         -------
    3935         x0 : array
     3922        :returns: x0 : array
    39363923            The starting parameters vector.
    39373924        """
  • branch/2frame/GSASIIpath.py

    r2952 r2967  
    4141    :returns: the value found or the default.
    4242    '''
    43     return configDict.get(key,default)
     43    try:
     44        return configDict.get(key,default)
     45    except NameError: # this happens when building docs
     46        return None
    4447
    4548def SetConfigValue(parmdict):
     
    671674    global BinaryPathLoaded
    672675    if BinaryPathLoaded: return
    673     inpver = intver(np.__version__)
     676    try:
     677        inpver = intver(np.__version__)
     678    except AttributeError: # happens on building docs
     679        return
    674680    binpath = None
    675681    binprfx = GetBinaryPrefix()
  • branch/2frame/GSASIIplot.py

    r2964 r2967  
    2525import mpl_toolkits.mplot3d.axes3d as mp3d
    2626import GSASIIpath
    27 Clip_on = GSASIIpath.GetConfigValue('Clip_on')
    2827GSASIIpath.SetVersionNumber("$Revision$")
    2928import GSASIIdataGUI as G2gd
     
    16961695        New peaks are also added here.
    16971696        '''
     1697        Clip_on = GSASIIpath.GetConfigValue('Clip_on')
    16981698        plotNum = G2frame.G2plotNB.plotList.index('Powder Patterns')
    16991699        Page = G2frame.G2plotNB.nb.GetPage(plotNum)
     
    18261826    #=====================================================================================
    18271827    # beginning PlotPatterns execution
     1828    Clip_on = GSASIIpath.GetConfigValue('Clip_on')
    18281829    new,plotNum,Page,Plot,limits = G2frame.G2plotNB.FindPlotTab('Powder Patterns','mpl')
    18291830    if not new:
  • branch/2frame/GSASIIscriptable.py

    r2963 r2967  
    88########### SVN repository information ###################
    99"""
     10*GSASIIscriptable: Scripting Tools*
     11-----------------------------------
     12
     13Routines for reading, writing, modifying and creating GSAS-II project (.gpx) files.
    1014
    1115"""
     
    4145def LoadDictFromProjFile(ProjFile):
    4246    '''Read a GSAS-II project file and load items to dictionary
    43     :param: str ProjFile: GSAS-II project (name.gpx) full file name
    44     :returns: dict Project: representation of gpx file following the GSAS-II tree struture
     47    :param str ProjFile: GSAS-II project (name.gpx) full file name
     48    :returns: Project,nameList, where
     49   
     50      * Project (dict) is a representation of gpx file following the GSAS-II tree struture
    4551        for each item: key = tree name (e.g. 'Controls','Restraints',etc.), data is dict
    4652        data dict = {'data':item data whch may be list, dict or None,'subitems':subdata (if any)}
    47     :returns: list nameList: names of main tree entries & subentries used to reconstruct project file
    48 
    49     Example for fap.gpx:
    50     Project = {                 #NB:dict order is not tree order
     53      * nameList (list) has names of main tree entries & subentries used to reconstruct project file
     54
     55    Example for fap.gpx::
     56   
     57      Project = {                 #NB:dict order is not tree order
    5158        u'Phases':{'data':None,'fap':{phase dict}},
    5259        u'PWDR FAP.XRA Bank 1':{'data':[histogram data list],'Comments':comments,'Limits':limits, etc},
     
    5663        u'Notebook':{'data':[notebook list]},
    5764        u'Restraints':{'data':{restraint data dict}},
    58         u'Constraints':{'data':{constraint data dict}}]}
    59     nameList = [                #NB: reproduces tree order
     65        u'Constraints':{'data':{constraint data dict}}]
     66        }
     67      nameList = [                #NB: reproduces tree order
    6068        [u'Notebook',],
    6169        [u'Controls',],
     
    7482             u'Unit Cells List',
    7583             u'Reflection Lists'],
    76         [u'Phases',
    77              u'fap']]
     84        [u'Phases', u'fap']
     85        ]
     86       
    7887    '''
    7988    if not ospath.exists(ProjFile):
     
    106115def SaveDictToProjFile(Project,nameList,ProjFile):
    107116    '''Save a GSAS-II project file from dictionary/nameList created by LoadDictFromProjFile
    108     param: dict Project: representation of gpx file following the GSAS-II
    109         tree struture as described for LoadDictFromProjFile
    110     param: list nameList: names of main tree entries & subentries used to reconstruct project file
    111     param: str ProjFile: full file name for output project.gpx file (including extension)
     117   
     118    :param dict Project: representation of gpx file following the GSAS-II
     119      tree structure as described for LoadDictFromProjFile
     120    :param list nameList: names of main tree entries & subentries used to reconstruct project file
     121    :param str ProjFile: full file name for output project.gpx file (including extension)
     122   
    112123    '''
    113124    file = open(ProjFile,'wb')
     
    125136def ImportPowder(reader,filename):
    126137    '''Use a reader to import a powder diffraction data file
    127     param: str reader: a scriptable reader
    128     param: str filename: full name of powder data file; can be "multi-Bank" data
    129     returns: list rdlist: list of rrader objects containing powder data, one for each
    130         "Bank" of data encountered in file
    131         items in reader object of interest are:
    132             rd.comments: list of str: comments found on powder file
    133             rd.dnames: list of str: data nammes suitable for use in GSASII data tree
    134                 NB: duplicated in all rd entries in rdlist
    135             rd.powderdata: list of numpy arrays: pos,int,wt,zeros,zeros,zeros as needed
    136                 for a PWDR entry in  GSASII data tree.       
     138   
     139    :param str reader: a scriptable reader
     140    :param str filename: full name of powder data file; can be "multi-Bank" data
     141   
     142    :returns: list rdlist: list of rrader objects containing powder data, one for each
     143      "Bank" of data encountered in file. Items in reader object of interest are:
     144     
     145        * rd.comments: list of str: comments found on powder file
     146        * rd.dnames: list of str: data nammes suitable for use in GSASII data tree NB: duplicated in all rd entries in rdlist
     147        * rd.powderdata: list of numpy arrays: pos,int,wt,zeros,zeros,zeros as needed for a PWDR entry in  GSASII data tree.
     148             
    137149    '''
    138150    rdfile,rdpath,descr = imp.find_module(reader)
  • branch/2frame/docs/source/GSASIIGUI.rst

    r2027 r2967  
    11*GSAS-II GUI Submodules*
    22========================
     3
     4.. automodule:: GSASIIdataGUI
     5    :members:
    36
    47.. automodule:: GSASIIphsGUI
  • branch/2frame/docs/source/GSASIIGUIr.rst

    r2027 r2967  
    1 *GSAS-II GUI Routines*
    2 ======================
     1*GSAS-II GUI Support Routines*
     2==============================
    33
    4 .. automodule:: GSASIIctrls
    5     :members:
    6 
    7 .. automodule:: GSASIIgrid
     4.. automodule:: GSASIIctrlGUI
    85    :members:
    96
     
    1613.. automodule:: GSASIIpy3
    1714    :members:
     15
  • branch/2frame/docs/source/GSASIIscripts.rst

    r2802 r2967  
    11*GSAS-II Scripts*
    22=================
     3
     4.. automodule:: GSASIIscriptable
     5    :members:
    36
    47.. automodule:: testDeriv
  • branch/2frame/docs/source/conf.py

    r2832 r2967  
    103103sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
    104104
    105 
    106105# If extensions (or modules to document with autodoc) are in another directory,
    107106# add these directories to sys.path here. If the directory is relative to the
     
    112111sys.path.insert(1, os.path.abspath(os.path.join('..', '..','imports')))
    113112#print(sys.path)
     113# import all files to set version number
    114114import glob
    115115for fil in glob.glob(os.path.abspath(os.path.join('..', '..','*.py'))):
    116116    pkg = os.path.splitext(os.path.split(fil)[1])[0]
    117     exec('import '+pkg)
     117    try:
     118        exec('import '+pkg)
     119    except:
     120        pass
    118121import GSASIIpath
    119122version = GSASIIpath.GetVersionNumber()
     
    133136# The suffix of source filenames.
    134137source_suffix = '.rst'
    135 
    136138# The encoding of source files.
    137139#source_encoding = 'utf-8-sig'
  • branch/2frame/docs/source/index.rst

    r2832 r2967  
    3030
    3131* wxPython (http://wxpython.org/docs/api/),
    32   * note that GSAS-II has been tested with wxPython 2.x and 3.0.x; It
    33     it expected to have problems with wxPython 4.x at present.
     32  * note that GSAS-II has been tested with wxPython 2.x and 3.0.x; It it expected to have problems with wxPython 4.x at present.
    3433* NumPy (http://docs.scipy.org/doc/numpy/reference/),
    3534* SciPy (http://docs.scipy.org/doc/scipy/reference/),
Note: See TracChangeset for help on using the changeset viewer.