Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control-C during plotting triggers AttributeError: 'Dict' object has no attribute 'xlim' #22

Open
haavee opened this issue Jul 28, 2022 · 1 comment

Comments

@haavee
Copy link
Owner

haavee commented Jul 28, 2022

Every now and then I saw this error popping up: 'Dict' object has no attribute 'xlim', but did not now how to reproduce.

Accidentally, when running with debug info and playing around, seem to have found a way to reproduce: press ^C whilst the system is generating the plots. The next attempt to plot will give this error at the end.

As a bonus, here's the backtrace:

jcli> cd /jop98_2/scratch/cook/VLA; ms line1.ms; indexr; pt phachan; scan 2-5; avt vector; nxy 4 12; new time t; sort bl time; show noheader; pl
ms: Current MS is 'line1.ms' containing 388700 rows of Spectral data for uid://evla/pdb/36820386 [DATA]
Running indexr. This may take some time.
indexr: found  10  scans. (use 'listr' to inspect)
plotType:                 phachan [phase versus channel]
  2: 04-Aug-2019/09:25:57.000  11m31.50s dT:12.00s J0542+4951      (0) (ARRAY_ID 0)
  3: 04-Aug-2019/09:37:39.000  42m24.00s dT:12.00s 3C84            (1) (ARRAY_ID 0)
  4: 04-Aug-2019/10:20:18.000  13m45.00s dT:12.00s J0542+4951      (0) (ARRAY_ID 0)
  5: 04-Aug-2019/10:34:15.000  42m24.00s dT:12.00s 3C84            (1) (ARRAY_ID 0)
averageTime:              Vector
layout[phachan]:          48 plots organized as 4 x 12 [flexible,rows]
new plots on:             FQ BL TIME
sort order [phachan]: bl time
show[phachan]:            NoHeader
Query took		0.067s
Data munching took      21.293s
WARNING: 200 out of 2600 data sets contained only NaN values (7.69%)!
min/max processing took	0.015s
Traceback (most recent call last):
  File "/jop98_0/scratch/verkout/src/jiveplot/command.py", line 439, in run
    drap(lambda x: self.parseOneCmd(x) if not self.exit else None, \
  File "/jop98_0/scratch/verkout/src/jiveplot/functional.py", line 95, in <lambda>
    drap        = lambda *args, **kwargs: drain(map(*args, **kwargs))
  File "/jop98_0/scratch/verkout/src/jiveplot/command.py", line 439, in <lambda>
    drap(lambda x: self.parseOneCmd(x) if not self.exit else None, \
  File "/jop98_0/scratch/verkout/src/jiveplot/command.py", line 544, in parseOneCmd
    cmd.cb()
  File "/jop98_0/scratch/verkout/src/jiveplot/jplotter.py", line 2499, in <lambda>
    cb=lambda : do_plot(env()), id="pl") )
  File "/jop98_0/scratch/verkout/src/jiveplot/jplotter.py", line 2463, in do_plot
    redraw_after_new(e)
  File "/jop98_0/scratch/verkout/src/jiveplot/jplotter.py", line 2486, in redraw_after_new
    do_redraw(e)
  File "/jop98_0/scratch/verkout/src/jiveplot/jplotter.py", line 2495, in do_redraw
    j().drawFunc(e.plots, ppgplot, e.first, foo[o.curdev].navigable(), ncol=e.devNColor)
  File "/jop98_0/scratch/verkout/src/jiveplot/jplotter.py", line 1687, in drawFunc
    plotter.drawfunc(dev, plotar, fst, onePage, **opts)
  File "/jop98_0/scratch/verkout/src/jiveplot/plots.py", line 1529, in drawfunc
    xmin     = reduce(min, map(lambda x: plotar.limits[x].xlim[0], self.yAxis), float('inf'))
  File "/jop98_0/scratch/verkout/src/jiveplot/plots.py", line 1529, in <lambda>
    xmin     = reduce(min, map(lambda x: plotar.limits[x].xlim[0], self.yAxis), float('inf'))
AttributeError: 'Dict' object has no attribute 'xlim'
'Dict' object has no attribute 'xlim'
@haavee
Copy link
Owner Author

haavee commented Aug 5, 2022

Update Actually, it's not the ^C itself that triggers it, it's the avt (and possibly avc). When this is active and the plotting is interrupted, the quantities remain of type raw and never get converted to e.g. phase anymore. The limits contain complex numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant