Changeset 1688


Ignore:
Timestamp:
Mar 3, 2015 3:01:18 PM (7 years ago)
Author:
toby
Message:

allow non-identical sequential refinement when copynext is not used (still bugs on table display); implement tutorial downloads

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r1672 r1688  
    20102010            morehelpitems=[('&Tutorials','Tutorials')])
    20112011        menubar.Append(menu=HelpMenu,title='&Help')
     2012        # this will eventually go away
     2013        HelpMenu=G2G.MyHelp(self,helpType='Data tree',
     2014            morehelpitems=[('&New Tutorials','NewTutorials')])
     2015        menubar.Append(menu=HelpMenu,title='&Help')
    20122016
    20132017    def _init_ctrls(self, parent):
  • trunk/GSASIIctrls.py

    r1657 r1688  
    14811481            print 'Error: help lookup failed!',event.GetEventObject()
    14821482            print 'id=',event.GetId()
    1483         else:
    1484             if helpType == 'Tutorials':
    1485                 self.frame.Tutorials = True
     1483        elif helpType == 'Tutorials':
     1484            self.frame.Tutorials = True
     1485            ShowHelp(helpType,self.frame)
     1486        elif helpType == 'NewTutorials': # this is just for testing
     1487            dlg = OpenTutorial(self.frame)
     1488            if dlg.ShowModal() == wx.ID_OK:
     1489                self.frame.Tutorials = True
     1490            dlg.Destroy()
     1491            return
     1492        else:
    14861493            ShowHelp(helpType,self.frame)
    14871494
     
    16941701            wx.Button.__init__(self,parent,wx.ID_ANY,'?',style=wx.BU_EXACTFIT)
    16951702        self.Bind(wx.EVT_BUTTON,self._onPress)
    1696         self.msg=msg
     1703        self.msg=StripIndents(msg)
    16971704        self.parent = parent
    16981705    def _onClose(self,event):
     
    17561763            xs,ys = self.htmlwin.GetViewStart()
    17571764            self.htmlwin.Scroll(xs,ys-1)
    1758 
     1765################################################################################
    17591766class G2HtmlWindow(wx.html.HtmlWindow):
    17601767    '''Displays help information in a primitive HTML browser type window
     
    17771784        self.parent.frame.SetTitle(self.GetOpenedPage() + ' -- ' +
    17781785            self.GetOpenedPageTitle())
     1786
     1787################################################################################
     1788def StripIndents(msg):
     1789    'Strip indentation from multiline strings'
     1790    msg1 = msg.replace('\n ','\n')
     1791    while msg != msg1:
     1792        msg = msg1
     1793        msg1 = msg.replace('\n ','\n')
     1794    return msg.replace('\n\t','\n')
     1795
     1796def G2MessageBox(parent,msg,title='Error'):
     1797    '''Simple code to display a error or warning message
     1798    '''
     1799    dlg = wx.MessageDialog(parent,StripIndents(msg), title, wx.OK)
     1800    dlg.ShowModal()
     1801    dlg.Destroy()
     1802       
    17791803################################################################################
    17801804class downdate(wx.Dialog):
     
    18981922        else:
    18991923            webbrowser.open(pfx+helplink, new=0, autoraise=True)
     1924def ShowWebPage(URL,frame):
     1925    '''Called to show a tutorial web page.
     1926    '''
     1927    global htmlFirstUse
     1928    # determine if a web browser or the internal viewer should be used for help info
     1929    if GSASIIpath.GetConfigValue('Help_mode'):
     1930        helpMode = GSASIIpath.GetConfigValue('Help_mode')
     1931    else:
     1932        helpMode = 'browser'
     1933    if helpMode == 'internal':
     1934        try:
     1935            htmlPanel.LoadFile(URL)
     1936            htmlFrame.Raise()
     1937        except:
     1938            htmlFrame = wx.Frame(frame, -1, size=(610, 510))
     1939            htmlFrame.Show(True)
     1940            htmlFrame.SetTitle("HTML Window") # N.B. reset later in LoadFile
     1941            htmlPanel = MyHtmlPanel(htmlFrame,-1)
     1942            htmlPanel.LoadFile(URL)
     1943    else:
     1944        if URL.startswith('http'):
     1945            pfx = ''
     1946        elif sys.platform.lower().startswith('win'):
     1947            pfx = ''
     1948        else:
     1949            pfx = "file://"
     1950        if htmlFirstUse:
     1951            webbrowser.open_new(pfx+URL)
     1952            htmlFirstUse = False
     1953        else:
     1954            webbrowser.open(pfx+URL, new=0, autoraise=True)
    19001955################################################################################
    19011956#### Tutorials selector
    19021957################################################################################
     1958G2BaseURL = "https://subversion.xray.aps.anl.gov/pyGSAS"
     1959tutorialCatalog = (
     1960    # tutorial dir,      exercise dir,      web page file name                                title for page
     1961    ['TOF Calibration', 'TOF Calibration', 'Calibration of a TOF powder diffractometer.htm', 'Calibration of a TOF powder diffractometer'],
     1962    ['TOF Charge Flipping', 'TOF Charge Flipping', 'Charge Flipping with TOF single crystal data in GSASII.htm',
     1963     'Charge flipping with neutron TOF single crystal data'],
     1964    ['TOF Sequential Single Peak Fit', 'TOF Sequential Single Peak Fit', '', ''],
     1965    ['TOF Single Crystal Refinement', 'TOF Single Crystal Refinement', '', ''],
     1966    ['TOF-CW Joint Refinement', 'TOF-CW Joint Refinement', '', ''],
     1967    )
     1968if GSASIIpath.GetConfigValue('Tutorial_location'):
     1969    tutorialPath = GSASIIpath.GetConfigValue('Tutorial_location')
     1970else:
     1971    tutorialPath = GSASIIpath.path2GSAS2
     1972   
     1973class OpenTutorial(wx.Dialog):
     1974    '''Open a tutorial, optionally copying it to the local disk. Always copy
     1975    the data files locally.
     1976
     1977    For now tutorials will always be copied into the source code tree, but it
     1978    might be better to have an option to copy them somewhere else, for people
     1979    who don't have write access to the GSAS-II source code location.
     1980    '''
     1981    # TODO: set default input-file open location to the download location
     1982    def __init__(self,parent=None):
     1983        style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
     1984        wx.Dialog.__init__(self, parent, wx.ID_ANY, 'Open Tutorial', style=style)
     1985        self.frame = parent
     1986        pnl = wx.Panel(self)
     1987        sizer = wx.BoxSizer(wx.VERTICAL)
     1988        label = wx.StaticText(
     1989            pnl,  wx.ID_ANY,
     1990            'Select the tutorial to be run and the mode of access'
     1991            )
     1992        sizer.Add(label, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
     1993        msg = '''To save download time for GSAS-II tutorials and their
     1994        sample data files are being moved out of the standard
     1995        distribution. This dialog allows users to load selected
     1996        tutorials to their computer.
     1997
     1998        Tutorials can be viewed over the internet or downloaded
     1999        to this computer. The sample data can be downloaded or not,
     2000        (but it is not possible to run the tutorial without the
     2001        data). If no web access is available, tutorials that were
     2002        previously downloaded can be viewed.
     2003
     2004        By default, files are downloaded into the location used
     2005        for the GSAS-II distribution, but this may not be possible
     2006        if the software is installed by a administrator. The
     2007        download location can be changed using the "Set data
     2008        location" or the "Tutorial_location" configuration option
     2009        (see config_example.py).
     2010        '''
     2011        hlp = HelpButton(pnl,msg)
     2012        sizer.Add(hlp,0,wx.ALIGN_RIGHT|wx.ALL)
     2013        #======================================================================
     2014        # This is needed only until we get all the tutorials items moved
     2015        btn = wx.Button(pnl, wx.ID_ANY, "Open older tutorials")
     2016        btn.Bind(wx.EVT_BUTTON, self.OpenOld)
     2017        sizer.Add(btn,0,wx.ALIGN_CENTRE|wx.ALL)
     2018        #======================================================================
     2019        self.BrowseMode = 1
     2020        choices = [
     2021            'make local copy of tutorial and data, then open',
     2022            'run from web (copy data locally)',
     2023            'browse on web (data not loaded)',
     2024            'open from local tutorial copy',
     2025        ]
     2026        self.mode = wx.RadioBox(pnl,wx.ID_ANY,'access mode:',
     2027                                wx.DefaultPosition, wx.DefaultSize,
     2028                                choices, 1, wx.RA_SPECIFY_COLS)
     2029        self.mode.SetSelection(self.BrowseMode)
     2030        self.mode.Bind(wx.EVT_RADIOBOX, self.OnModeSelect)
     2031        sizer.Add(self.mode,0,WACV)
     2032        sizer1 = wx.BoxSizer(wx.HORIZONTAL)
     2033        btn = wx.Button(pnl, wx.ID_ANY, "Set download location")
     2034        btn.Bind(wx.EVT_BUTTON, self.SelectDownloadLoc)
     2035        sizer1.Add(btn,0,WACV)
     2036        self.dataLoc = wx.StaticText(pnl, wx.ID_ANY,tutorialPath)
     2037        sizer1.Add(self.dataLoc,0,WACV)
     2038        sizer.Add(sizer1)
     2039        self.listbox = wx.ListBox(pnl, wx.ID_ANY, size=(450, 100), style=wx.LB_SINGLE)
     2040        self.listbox.Bind(wx.EVT_LISTBOX, self.OnTutorialSelected)
     2041        self.OnModeSelect(None)
     2042        #self.FillListBox()
     2043        sizer.Add(self.listbox,1,WACV|wx.EXPAND|wx.ALL,1)
     2044       
     2045        btnsizer = wx.StdDialogButtonSizer()
     2046        btn = wx.Button(pnl, wx.ID_CANCEL)
     2047        btnsizer.AddButton(btn)
     2048        btnsizer.Realize()
     2049        sizer.Add(btnsizer, 0, wx.ALIGN_CENTER|wx.ALL, 5)
     2050        pnl.SetSizer(sizer)
     2051        sizer.Fit(self)
     2052        self.topsizer=sizer
     2053        self.CenterOnParent()
     2054    def OpenOld(self,event):
     2055        '''Open old tutorials. This is needed only until we get all the tutorials items moved
     2056        '''
     2057        self.EndModal(wx.ID_OK)
     2058        self.frame.Tutorials = True
     2059        ShowHelp('Tutorials',self.frame)
     2060    def OnModeSelect(self,event):
     2061        '''Respond when the mode is changed
     2062        '''
     2063        self.BrowseMode = self.mode.GetSelection()
     2064        #self.FillListBox()
     2065    #def FillListBox(self):
     2066        if self.BrowseMode == 3:
     2067            import glob
     2068            filelist = glob.glob(tutorialPath+'/help/*/*.htm')
     2069            taillist = [os.path.split(f)[1] for f in filelist]
     2070            itemlist = [tut[-1] for tut in tutorialCatalog if tut[2] in taillist]
     2071        else:
     2072            itemlist = [tut[-1] for tut in tutorialCatalog if tut[-1]]
     2073        self.listbox.Clear()
     2074        self.listbox.AppendItems(itemlist)
     2075    def OnTutorialSelected(self,event):
     2076        '''Respond when a tutorial is selected. Load tutorials and data locally,
     2077        as needed and then display the page
     2078        '''
     2079        for tutdir,exedir,htmlname,title in tutorialCatalog:
     2080            if title == event.GetString(): break
     2081        else:
     2082            raise Exception("Match to file not found")
     2083        if self.BrowseMode == 0 or self.BrowseMode == 1:
     2084            try:
     2085                self.ValidateTutorialDir(tutorialPath,G2BaseURL)
     2086            except:
     2087                G2MessageBox(self.frame,
     2088            '''The selected directory is not valid.
     2089           
     2090            You must use a directory that you have write access
     2091            to. You can reuse a directory previously used for
     2092            downloads, but the help and Tutorials subdirectories
     2093             must be created by this routine.
     2094            ''')
     2095                return
     2096        self.dataLoc.SetLabel(tutorialPath)
     2097        if self.BrowseMode == 0:
     2098            # xfer data & web page locally, then open web page
     2099            self.LoadTutorial(tutdir,tutorialPath,G2BaseURL)
     2100            self.LoadExercise(exedir,tutorialPath,G2BaseURL)
     2101            URL = os.path.join(tutorialPath,'help',tutdir,htmlname)
     2102            ShowWebPage(URL,self.frame)
     2103        elif self.BrowseMode == 1:
     2104            # xfer data locally, open web page remotely
     2105            self.LoadExercise(exedir,tutorialPath,G2BaseURL)
     2106            URL = os.path.join(G2BaseURL,'Tutorials',tutdir,htmlname)
     2107            ShowWebPage(URL,self.frame)
     2108        elif self.BrowseMode == 2:
     2109            # open web page remotely, don't worry about data
     2110            URL = os.path.join(G2BaseURL,'Tutorials',tutdir,htmlname)
     2111            ShowWebPage(URL,self.frame)
     2112        elif self.BrowseMode == 3:
     2113            # open web page that has already been transferred
     2114            URL = os.path.join(tutorialPath,'help',tutdir,htmlname)
     2115            ShowWebPage(URL,self.frame)
     2116        else:
     2117            raise Exception("How did this happen!")
     2118        self.EndModal(wx.ID_OK)
     2119    def ValidateTutorialDir(self,fullpath=tutorialPath,baseURL=G2BaseURL):
     2120        '''Load help to new directory or make sure existing directory looks correctly set up
     2121        throws an exception if there is a problem.
     2122        '''
     2123        if os.path.exists(fullpath):
     2124            if os.path.exists(os.path.join(fullpath,"help")):
     2125                if not GSASIIpath.svnGetRev(os.path.join(fullpath,"help")):
     2126                    raise Exception("Problem with "+fullpath+" dir help exists but is not in SVN")
     2127            else:
     2128                raise Exception("Problem: dir "+fullpath+" exists does not contain help")
     2129            if os.path.exists(os.path.join(fullpath,"Exercises")):
     2130                if not GSASIIpath.svnGetRev(os.path.join(fullpath,"Exercises")):
     2131                    raise Exception("Problem with "+fullpath+" dir Exercises exists but is not in SVN")
     2132            else:
     2133                raise Exception("Problem: dir "+fullpath+" exists does not contain Exercises")
     2134        else:
     2135            if not GSASIIpath.svnInstallDir(baseURL+"/MT",fullpath):
     2136                raise Exception("Problem transferring empty directory from web")
     2137        return True
     2138
     2139    def LoadTutorial(self,tutorialname,fullpath=tutorialPath,baseURL=G2BaseURL):
     2140        'Load a Tutorial to the selected location'
     2141        if GSASIIpath.svnSwitchDir("help/"+tutorialname,baseURL+"/Tutorials/"+tutorialname,fullpath):
     2142            return True
     2143        raise Exception("Problem transferring Tutorial from web")
     2144    def LoadExercise(self,tutorialname,fullpath=tutorialPath,baseURL=G2BaseURL):
     2145        'Load Exercise file(s) for a Tutorial to the selected location'
     2146        if GSASIIpath.svnSwitchDir("Exercises/"+tutorialname,baseURL+"/Exercises/"+tutorialname,fullpath):
     2147            return True
     2148        raise Exception("Problem transferring Exercise from web")
     2149    def SelectDownloadLoc(self,event):
     2150        '''Select a download location,
     2151        Cancel resets to the default
     2152        '''
     2153        global tutorialPath
     2154        localpath = os.path.abspath(os.path.expanduser('~/G2tutorials'))
     2155        dlg = wx.DirDialog(self, "Choose a directory for downloads:",
     2156                           defaultPath=localpath)#,style=wx.DD_DEFAULT_STYLE)
     2157                           #)
     2158        if dlg.ShowModal() == wx.ID_OK:
     2159            pth = dlg.GetPath()
     2160        else:
     2161            if GSASIIpath.GetConfigValue('Tutorial_location'):
     2162                pth = GSASIIpath.GetConfigValue('Tutorial_location')
     2163            else:
     2164                pth = GSASIIpath.path2GSAS2
     2165        if not os.path.exists(pth):
     2166            try:
     2167                os.makedirs(pth)
     2168            except OSError:
     2169                G2MessageBox(self.frame,
     2170                '''The selected directory is not valid.
    19032171               
     2172                It appears you do not have write access to this location.
     2173                ''')
     2174                return
     2175        try:
     2176            self.ValidateTutorialDir(pth,G2BaseURL)
     2177            tutorialPath = pth
     2178        except:
     2179            G2MessageBox(self.frame,
     2180            '''The selected directory is not valid.
     2181           
     2182            You must use a directory that you have write access
     2183            to. You can reuse a directory previously used for
     2184            downloads, but the help and Tutorials subdirectories
     2185             must be created by this routine.
     2186            ''')
     2187        self.dataLoc.SetLabel(tutorialPath)
     2188   
    19042189if __name__ == '__main__':
    19052190    app = wx.PySimpleApp()
     2191    GSASIIpath.InvokeDebugOpts()
    19062192    frm = wx.Frame(None) # create a frame
    19072193    frm.Show(True)
    1908 
     2194    dlg = OpenTutorial(frm)
     2195    if dlg.ShowModal() == wx.ID_OK:
     2196        print "OK"
     2197    else:
     2198        print "Cancel"
     2199    dlg.Destroy()
     2200    import sys
     2201    sys.exit()
    19092202    #======================================================================
    19102203    # test ScrolledMultiEditor
  • trunk/GSASIIgrid.py

    r1673 r1688  
    134134] = [wx.NewId() for item in range(10)]
    135135
    136 [ wxID_RENAMESEQSEL,wxID_SAVESEQSEL,wxID_SAVESEQSELCSV,wxID_PLOTSEQSEL,wxID_ORGSEQSEL,
    137   wxADDSEQVAR,wxDELSEQVAR,wxEDITSEQVAR,wxCOPYPARFIT,
     136[ wxID_RENAMESEQSEL,wxID_SAVESEQSEL,wxID_SAVESEQSELCSV,wxID_SAVESEQCSV,wxID_PLOTSEQSEL,
     137  wxID_ORGSEQSEL,wxADDSEQVAR,wxDELSEQVAR,wxEDITSEQVAR,wxCOPYPARFIT,
    138138  wxADDPARFIT,wxDELPARFIT,wxEDITPARFIT,wxDOPARFIT,
    139 ] = [wx.NewId() for item in range(13)]
     139] = [wx.NewId() for item in range(14)]
    140140
    141141[ wxID_MODELCOPY,wxID_MODELFIT,wxID_MODELADD,wxID_ELEMENTADD,wxID_ELEMENTDELETE,
     
    15761576        self.SequentialFile.Append(id=wxID_SAVESEQSEL, kind=wx.ITEM_NORMAL,text='Save selected as text',
    15771577            help='Save selected sequential refinement results as a text file')
     1578        self.SequentialFile.Append(id=wxID_SAVESEQCSV, kind=wx.ITEM_NORMAL,text='Save all as CSV',
     1579            help='Save all sequential refinement results as a CSV spreadsheet file')
    15781580        self.SequentialFile.Append(id=wxID_SAVESEQSELCSV, kind=wx.ITEM_NORMAL,text='Save selected as CSV',
    15791581            help='Save selected sequential refinement results as a CSV spreadsheet file')
     
    28802882        OnSaveSelSeq(event,csv=True)
    28812883       
    2882     def OnSaveSelSeq(event,csv=False):
    2883         'export the selected columns to a .txt file from menu command'
     2884    def OnSaveSeqCSV(event):
     2885        'export all columns to a .csv file from menu command'
     2886        OnSaveSelSeq(event,csv=True,allcols=True)
     2887       
     2888    def OnSaveSelSeq(event,csv=False,allcols=False):
     2889        'export the selected columns to a .txt or .csv file from menu command'
    28842890        def WriteCSV():
    28852891            def WriteList(headerItems):
     
    28922898            for col in cols:
    28932899                item = G2frame.SeqTable.GetColLabelValue(col)
     2900                # get rid of labels that have Unicode characters
     2901                if not all([ord(c) < 128 and ord(c) != 0 for c in item]): item = '?'
    28942902                if col in havesig:
    28952903                    head += [item,'esd-'+item]
     
    29252933
    29262934        # start of OnSaveSelSeq code
    2927         cols = sorted(G2frame.dataDisplay.GetSelectedCols()) # ignore selection order
     2935        if allcols:
     2936            cols = range(G2frame.SeqTable.GetNumberCols())
     2937        else:
     2938            cols = sorted(G2frame.dataDisplay.GetSelectedCols()) # ignore selection order
    29282939        nrows = G2frame.SeqTable.GetNumberRows()
    29292940        if not cols:
     
    34833494    G2frame.dataFrame.Bind(wx.EVT_MENU, OnSaveSelSeq, id=wxID_SAVESEQSEL)
    34843495    G2frame.dataFrame.Bind(wx.EVT_MENU, OnSaveSelSeqCSV, id=wxID_SAVESEQSELCSV)
     3496    G2frame.dataFrame.Bind(wx.EVT_MENU, OnSaveSeqCSV, id=wxID_SAVESEQCSV)
    34853497    G2frame.dataFrame.Bind(wx.EVT_MENU, OnPlotSelSeq, id=wxID_PLOTSEQSEL)
    34863498    G2frame.dataFrame.Bind(wx.EVT_MENU, OnReOrgSelSeq, id=wxID_ORGSEQSEL)
     
    37153727    )
    37163728    name = histNames[0]
    3717    
     3729
     3730    #******************************************************************************
     3731    # this does not work for refinements that have differing numbers of variables.
     3732    #raise Exception
    37183733    indepVarDict = {     #  values in table w/o ESDs
    37193734        var:colList[i][0] for i,var in enumerate(colLabels) if colSigs[i] is None
     
    37263741    # add recip cell coeff. values
    37273742    depVarDict.update({var:val for var,val in data[name].get('newCellDict',{}).values()})
    3728    
     3743
    37293744    G2frame.dataDisplay = GSGrid(parent=G2frame.dataFrame)
    37303745    G2frame.SeqTable = Table(
  • trunk/GSASIIpath.py

    r1676 r1688  
    313313
    314314    This is currently used for moving tutorial web pages and demo files
    315     into the GSAS-II source tree.
     315    into the GSAS-II source tree. Note that if the files were previously downloaded
     316    the switch command will update the files to the newest version.
    316317   
    317318    :param str rpath: path to locate files, relative to the GSAS-II
    318319      installation path (defaults to path2GSAS2)
    319320    :param str URL: the repository URL
     321    :param str loadpath: the prefix for the path, if specified. Defaults to path2GSAS2
    320322    '''
    321323    import subprocess
     
    333335                         stdout=subprocess.PIPE,stderr=subprocess.PIPE)
    334336    out,err = s.communicate()
    335     print out
    336337    if err:
    337338        s = subprocess.Popen(cmd,
     
    343344            print(60*"=")
    344345            print err
    345 
     346            return False
     347    return True
     348
     349def svnInstallDir(URL,loadpath):
     350    '''Load a subversion tree into a specified directory
     351
     352    :param str rpath: path to locate files, relative to the GSAS-II
     353      installation path (defaults to path2GSAS2)
     354    :param str URL: the repository URL
     355    '''
     356    import subprocess
     357    svn = whichsvn()
     358    if not svn: return
     359    if os.path.exists(loadpath):
     360        raise Exception("Error: Attempting to create existing directory "+loadpath)
     361    cmd = [svn,'co',URL,loadpath,'--non-interactive']
     362    print("Loading files from "+URL)
     363    s = subprocess.Popen(cmd+['--trust-server-cert'],
     364                         stdout=subprocess.PIPE,stderr=subprocess.PIPE)
     365    out,err = s.communicate()
     366    if err:
     367        print out
     368        s = subprocess.Popen(cmd,
     369                         stdout=subprocess.PIPE,stderr=subprocess.PIPE)
     370        out,err = s.communicate()
     371        if err:
     372            print(60*"=")
     373            print ("****** An error was noted, see below *********")
     374            print(60*"=")
     375            print err
     376            return False
     377    return True
     378
     379           
    346380def IPyBreak_base():
    347381    '''A routine that invokes an IPython session at the calling location
  • trunk/GSASIIstrMain.py

    r1643 r1688  
    5454        begin = time.time()
    5555        values =  np.array(G2stMth.Dict2Values(parmDict, varyList))
     56        # test code to compute GOF and save for external repeat
     57        #args = ([Histograms,Phases,restraintDict,rigidbodyDict],parmDict,varyList,calcControls,pawleyLookup,dlg)
     58        #print '*** before fit chi**2',np.sum(G2stMth.errRefine(values,*args)**2)           
     59        #fl = open('beforeFit.cpickle','wb')
     60        #import cPickle
     61        #cPickle.dump(values,fl,1)
     62        #cPickle.dump(args[:-1],fl,1)
     63        #fl.close()
    5664        Ftol = Controls['min dM/M']
    5765        Factor = Controls['shift factor']
     
    329337                item = ':'.join(items)
    330338                newVaryList.append(item)
    331         if newVaryList != firstVaryList:
    332             # variable lists are expected to match between sequential refinements
     339        if newVaryList != firstVaryList and Controls['Copy2Next']:
     340            # variable lists are expected to match between sequential refinements when Copy2Next is on
    333341            print '**** ERROR - variable list for this histogram does not match previous'
     342            print '     Copy of variables is not possible'
    334343            print '\ncurrent histogram',histogram,'has',len(newVaryList),'variables'
    335344            combined = list(set(firstVaryList+newVaryList))
  • trunk/config_example.py

    r1657 r1688  
    3636Help_mode = None
    3737'Set to "internal" to use a Python-based web viewer rather than a web browser'
     38
     39Tutorial_location = None
     40'''Change this to place tutorials by in a different spot. If None, this defaults to
     41the location where GSAS-II is loaded GSASIIpath.path2GSAS2. For installations where
     42G2 is installed by an administrator, it is a good idea to use something like this:
     43    import os.path
     44    Tutorial_location = os.path.expanduser('~/G2tutorials')
     45This will allow users to download tutorial files into their own file space.
     46'''
Note: See TracChangeset for help on using the changeset viewer.