question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Drawing compound objects not backwards compatible between 2.6.5 and 2.6.4?

See original GitHub issue

I have some code which works in 2.6.4 which is raising an error in 2.6.5.

I have a CompoundObject called obj, which is created from a list, l of Polygons and Paths as so:

obj = CompoundObject(*l)

I am attempting to display this object inside a tkw.ImageViewTk.ImageViewCanvas called fi using:

canvas = fi.canvas
canvas.deleteObjectByTag('ccd_overlay')
canvas.add(obj, tag='ccd_overlay', redraw=False)
canvas.update_canvas()

which now (2.6.5) produces the following exception:

2017-10-09 14:40:23,971 | E | ImageView.py:1264 (redraw_now) | Error redrawing image: float() argument must be a string or a number, not 'generator'
2017-10-09 14:40:23,973 | E | ImageView.py:1269 (redraw_now) | Traceback:
  File "/Users/sl/anaconda3/lib/python3.6/site-packages/ginga/ImageView.py", line 1250, in redraw_now
    self.redraw_data(whence=whence)
  File "/Users/sl/anaconda3/lib/python3.6/site-packages/ginga/ImageView.py", line 1295, in redraw_data
    self.private_canvas.draw(self)
  File "/Users/sl/anaconda3/lib/python3.6/site-packages/ginga/canvas/DrawingMixin.py", line 723, in draw
    super(DrawingMixin, self).draw(viewer)
  File "/Users/sl/anaconda3/lib/python3.6/site-packages/ginga/canvas/CompoundMixin.py", line 141, in draw
    obj.draw(viewer)
  File "/Users/sl/anaconda3/lib/python3.6/site-packages/ginga/canvas/CompoundMixin.py", line 141, in draw
    obj.draw(viewer)
  File "/Users/sl/anaconda3/lib/python3.6/site-packages/ginga/canvas/types/basic.py", line 262, in draw
    cpoints = self.get_cpoints(viewer)
  File "/Users/sl/anaconda3/lib/python3.6/site-packages/ginga/canvas/CanvasObject.py", line 490, in get_cpoints
    return crdmap.data_to(points)
  File "/Users/sl/anaconda3/lib/python3.6/site-packages/ginga/canvas/coordmap.py", line 70, in data_to
    return viewer.tform['data_to_native'].to_(data_arr)
  File "/Users/sl/anaconda3/lib/python3.6/site-packages/ginga/canvas/transform.py", line 68, in to_
    return self.tform2.to_(self.tform1.to_(pts, **kwargs))
  File "/Users/sl/anaconda3/lib/python3.6/site-packages/ginga/canvas/transform.py", line 68, in to_
    return self.tform2.to_(self.tform1.to_(pts, **kwargs))
  File "/Users/sl/anaconda3/lib/python3.6/site-packages/ginga/canvas/transform.py", line 68, in to_
    return self.tform2.to_(self.tform1.to_(pts, **kwargs))
  File "/Users/sl/anaconda3/lib/python3.6/site-packages/ginga/canvas/transform.py", line 397, in to_
    data_pts = np.asarray(data_pts, dtype=np.float)
  File "/Users/sl/anaconda3/lib/python3.6/site-packages/numpy/core/numeric.py", line 531, in asarray
    return array(a, dtype, copy=False, order=order)

Any advice as to what’s changed would be appreciated!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
StuartLittlefaircommented, Oct 9, 2017

Yes - a finding chart tool for an instrument whose GUI is in tkinter.

This way I can reuse the modules from the instrument gui for window setup and S/N calcs.

1reaction
ejeschkecommented, Oct 10, 2017

I suppose we could do something like …

The more I dig into this, trying to convert the generator iterables at the right spots, the more I realize why probably numpy just decided to pass on this. I think for now we will simply say that points passed to graphics objects need to be finite non-generator sequences.

Relabeling as not a bug and closing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Release Notes - Python Arcade 2.6.16
Version 2.6.0 is a major update to Arcade. It is not 100% backwards compatible with the 2.5 API. Updates were made to text...
Read more >
2.6: Drawing Resonance Forms - Chemistry LibreTexts
Single barbed straight arrows one in the forward direction and one in the backward direction are. Resonance Arrows. Double headed arrows are ...
Read more >
Changelog | ProBuilder | 5.0.6 - Unity - Manual
Fixed Draw Shape tool not clearing selection when changing the active shape type. ... Remove backwards compatibility breaking API changes.
Read more >
Custom Shape Tutorial - LibreOffice Documentation
– Write down the meaning of the equations used in the custom shape. (We have no equations in this custom shape.) – The...
Read more >
EzCad2.10UNI User's Manual - Rabbit Laser USA
6.6 System Toolbar / View Toolbar / Draw Toolbar / Status Bar / Object ... “Cut” will delete the object selected from EzCad2...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found