taurus-org / taurus_pyqtgraph

Moved to https://gitlab.com/taurus-org/taurus_pyqtgraph
3 stars 14 forks source link

Problems when adding TaurusTrend to TaurusGUI with wizard #67

Closed reszelaz closed 4 years ago

reszelaz commented 4 years ago

I was going to try the new background colour feature and then I found the following problem. I started with creating a new TaurusGUI with the wizard and when adding a TaurusTrend I get:

The requested panel cannot be created. 
Reason:
AttributeError("'LegendItem' object has no attribute 'setPen'",)

The same happens for TaurusPlot. I use the taurus from develop and taurus_pyqtgraph from master, both installed in editable mode. I did reinstallation to upadte the entry points.

Something similar happens when executing taurus plot:

zreszela@pc255:~/workspace/taurus (develop)> taurus plot
/usr/lib/python3/dist-packages/h5py/__init__.py:34: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
MainThread     INFO     2020-09-03 11:33:11,213 TaurusRootLogger: Cannot load qwt5
Traceback (most recent call last):
  File "/home/zreszela/.local/bin/taurus", line 11, in <module>
    load_entry_point('taurus', 'console_scripts', 'taurus')()
  File "/home/zreszela/workspace/taurus/lib/taurus/cli/cli.py", line 132, in main
    taurus_cmd()
  File "/usr/lib/python3/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/zreszela/workspace/taurus/lib/taurus/cli/alt.py", line 207, in plot_cmd
    w = TPlot()
  File "/home/zreszela/workspace/taurus_pyqtgraph/taurus_pyqtgraph/plot.py", line 97, in __init__
    legend_tool.attachToPlotItem(self.getPlotItem())
  File "/home/zreszela/workspace/taurus_pyqtgraph/taurus_pyqtgraph/legendtool.py", line 65, in attachToPlotItem
    self._legend.setPen(pg.CONFIG_OPTIONS["foreground"])
AttributeError: 'LegendItem' object has no attribute 'setPen'
cpascual commented 4 years ago

I cannot reproduce it in my environment with

reszelaz commented 4 years ago

Yes, with pyqtgraph 0.11 it works. I was using the 0.10 version from the Debian repository. What do you think then to make the pyqtgraph dependency explicit >= 0.11 in setup.py?

cpascual commented 4 years ago

Definitely