Changeset 3426


Ignore:
Timestamp:
Jun 9, 2018 4:39:58 PM (3 years ago)
Author:
toby
Message:

Add scan of .gpx objects; try to fix bug on drag

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r3373 r3426  
    563563    File.close()
    564564    return
     565
     566objectScanIgnore = [int,bool,float,str,np.float64,np.ndarray]
     567if '2' in platform.python_version_tuple()[0]:
     568    objectScanIgnore += [unicode,]
     569   
     570def objectScan(data,tag,indexStack=[]):
     571    '''Scan an object looking for unexpected data types'''
     572    if type(data) is list or type(data) is tuple:
     573        for i in range(len(data)):
     574            objectScan(data[i],tag,indexStack+[i])
     575    elif type(data) is dict:
     576        for key in data:
     577            objectScan(data[key],tag,indexStack+[key])
     578    elif data is None:
     579        return
     580    elif type(data) in objectScanIgnore:
     581        return
     582    else:
     583        s = 'unexpected object in '+tag
     584        for i in indexStack:
     585            s += "[{}]".format(i)
     586        #print(s,data.__class__.__name__) # loses full name of class
     587        print(s,type(data))
    565588   
    566589def ProjFileOpen(G2frame,showProvenance=True):
     
    584607                break
    585608            datum = data[0]
    586            
     609            # scan the GPX file for unexpected objects
     610            if GSASIIpath.GetConfigValue('debug'):
     611                objectScan(data,datum[0])
    587612            Id = G2frame.GPXtree.AppendItem(parent=G2frame.root,text=datum[0])
    588613            if datum[0].startswith('PWDR'):               
  • trunk/GSASIIctrlGUI.py

    r3424 r3426  
    49714971    ['StartingGSASII', 'Starting GSAS.htm', 'Starting GSAS-II',
    49724972     '''An introduction to GSAS-II with starting instructions and a brief description of the displays.'''],
    4973     ['BkgFit', 'FitBkgTut.htm',  'Fitting the Starting Background using Fixed Points',
    4974      '''This shows how to get an initial estimate of background parameters from a suite of fixed points
    4975      before beginning Rietveld refinement.'''],
    49764973
    49774974    ['Rietveld refinement'],
     
    49874984    ['Simulation', 'SimTutorial.htm',  'Simulating Powder Diffraction with GSAS-II',
    49884985     '''This show how to create a simulated powder pattern from a lab diffractometer.'''],
     4986    ['BkgFit', 'FitBkgTut.htm',  'Fitting the Starting Background using Fixed Points',
     4987     '''This shows how to get an initial estimate of background parameters from a suite of fixed points
     4988     before beginning Rietveld refinement.'''],
    49894989   
    49904990    ['Parametric sequential fitting'],
  • trunk/GSASIIplot.py

    r3425 r3426  
    19661966            '''
    19671967            if event.xdata is None or event.ydata is None: return   # ignore if cursor out of window
     1968            if G2frame.itemPicked is None: return # not sure why this happens, if it does
    19681969            Page.canvas.restore_region(savedplot)
    19691970            G2frame.itemPicked.set_data([event.xdata], [event.ydata])
     
    19751976            '''
    19761977            if event.xdata is None: return   # ignore if cursor out of window
     1978            if G2frame.itemPicked is None: return # not sure why this happens
    19771979            Page.canvas.restore_region(savedplot)
    19781980            coords = G2frame.itemPicked.get_data()
     
    19861988            '''
    19871989            if event.ydata is None: return   # ignore if cursor out of window
     1990            if Page.tickDict is None: return # not sure why this happens, if it does
    19881991            Page.canvas.restore_region(savedplot)
    19891992            if Page.pickTicknum:
     
    20052008            '''
    20062009            if event.ydata is None: return   # ignore if cursor out of window
     2010            if G2frame.itemPicked is None: return # not sure why this happens
    20072011            Page.canvas.restore_region(savedplot)
    20082012            coords = G2frame.itemPicked.get_data()
Note: See TracChangeset for help on using the changeset viewer.