Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Too many refs causes TypeError

Help
2014-03-26
2014-03-26
  • Guy Hutchison
    Guy Hutchison
    2014-03-26

    I have a script which creates a set of base cells and then starts creating references to them. I am getting a problem in the viewer once I exceed a certain number of cells:
    Traceback (most recent call last):
    File "C:\Users\guy\Documents\pyscripts\gdstest.py", line 134, in <module>
    gdspy.LayoutViewer()
    File "C:\Python27\lib\site-packages\gdspy\viewer.py", line 262, in init
    self._update_canvas()
    File "C:\Python27\lib\site-packages\gdspy\viewer.py", line 318, in _update_canvas
    self._update_data(pol_dict)
    File "C:\Python27\lib\site-packages\gdspy\viewer.py", line 394, in _update_data
    self.l_canvas.configure(width=3hei+wid, scrollregion=(0,pos,3hei+wid,0), yscrollincrement=hei)
    TypeError: unsupported operand type(s) for *: 'int' and 'NoneType'

    If I back off on the number of cells I use it seems to work OK. Also exported GDS seems to be fine.

     
  • Heitzmann
    Heitzmann
    2014-03-26

    It seems to me that this might be caused by an empty cell (either referenced or displayed in LayoutViewer). Could that be the case?
    If so I'll work on that for the next release.

     
  • Guy Hutchison
    Guy Hutchison
    2014-03-26

    As far as I can tell there are no empty cells. I've attached the script for reference. It reads in a file names.txt and creates cell refs based on the contents of the file.

     
    Attachments
  • Heitzmann
    Heitzmann
    2014-03-26

    It seems to run without problems for me. I used a file with aroud 2600 line of text and it displayed everything.
    I saw you have many missing letters. Maybe one of your text line ends up empty because of that.
    Are you using the latest release?

     
  • Guy Hutchison
    Guy Hutchison
    2014-03-26

    Hmm, maybe its an OS/version issue, downloaded yesterday so should be latest release. I'll try building on Linux and see if that works.

    I've been adding the missing letters so there are no skips in my current text file (not every letter is used).

    Thanks!

     
  • Guy Hutchison
    Guy Hutchison
    2014-03-26

    I installed gdspy in a Linux VM and ran with the same result. I pared the test down to the bare minimum to try and figure out what was going on:

    import gdspy

    def test2():
    subcell = gdspy.Cell('SUBCELL')
    subcell.add (gdspy.Rectangle( (0,0),(15,10), 2))
    ref_cell = gdspy.Cell('REFS')
    ref_cell.add (gdspy.CellArray('SUBCELL',4,4, (20,20),(0,0)))

    test2()
    gdspy.LayoutViewer()

    When I run the script, the viewer starts up just fine, but when I switch from SUBCELL to REFS, I again get the exception:
    Exception in Tkinter callback
    Traceback (most recent call last):
    File "/usr/lib64/python2.7/lib-tk/Tkinter.py", line 1410, in call
    return self.func(args)
    File "/usr/lib64/python2.7/site-packages/gdspy/viewer.py", line 318, in _update_canvas
    self._update_data(pol_dict)
    File "/usr/lib64/python2.7/site-packages/gdspy/viewer.py", line 394, in _update_data
    self.l_canvas.configure(width=3
    hei+wid, scrollregion=(0,pos,3hei+wid,0), yscrollincrement=hei)
    TypeError: unsupported operand type(s) for
    : 'int' and 'NoneType'

    Interestingly, it seems to keep working after that...