Closed njcuk9999 closed 4 years ago
Sadly it appears this has been unmaintained since I left STScI in August 2017. At the time I think @robelgeda was slated to take over, but that may have changed. @mperrin may also know who the current responsible party is.
If that change fixes it, please do submit a pull request!
Attention @juliengirard, can you take a look at this issue please?
The way I managed to run it (python 3) ultimately is installing it with pip and not conda and forcing the installation of matplotlib 2.2.
That or using the precompiled version for Max OS.
This article may help: https://stackoverflow.com/questions/50330320/what-to-use-instead-of-navigationtoolbar2tkagg
In an easy world where NavigationToolbar2Tk
works exactly the same as NavigationToolbar2TkAgg
one could use a hack like the following:
try:
from matplotlib.backends.backend_tkagg import NavigationToolbar2TkAgg
except ImportError:
from matplotlib.backends.backend_tkagg import NavigationToolbar2Tk as NavigationToolbar2TkAgg
that would support both older matplotlib versions and newer ones.
though it is never as easy and would depend on your usage of NavigationToolbar2TkAgg and how it differs from the new NavigationToolbar2Tk class
I decided to go ahead and test the above (https://github.com/spacetelescope/jwst_coronagraph_visibility/issues/20#issuecomment-537627672) on my machine, it does indeed work however there is an additional problem with FigureCanvasTkAgg
as well
>> Traceback (most recent call last):
File "/scratch/bin/anaconda3/envs/astroconda/bin/jwst-coronagraph-visibility-gui", line 11, in <module>
load_entry_point('jwst-coronagraph-visibility==0.3.0', 'gui_scripts', 'jwst-coronagraph-visibility-gui')()
File "/scratch/bin/anaconda3/envs/astroconda/lib/python3.6/site-packages/jwst_coronagraph_visibility/gui.py", line 1262, in run
app = VisibilityCalculator()
File "/scratch/bin/anaconda3/envs/astroconda/lib/python3.6/site-packages/jwst_coronagraph_visibility/gui.py", line 335, in __init__
self._build()
File "/scratch/bin/anaconda3/envs/astroconda/lib/python3.6/site-packages/jwst_coronagraph_visibility/gui.py", line 402, in _build
self._build_plots(self.plot_frame)
File "/scratch/bin/anaconda3/envs/astroconda/lib/python3.6/site-packages/jwst_coronagraph_visibility/gui.py", line 779, in _build_plots
self._canvas.show()
AttributeError: 'FigureCanvasTkAgg' object has no attribute 'show'
however this error I have seen before (see here: https://github.com/jarvisteach/appJar/issues/551) basically all you need to do is any places you use FigureCanvasTkAgg.show()
(i.e. self._canvas.show()
in gui.py
) you need to add FigureCanvasTkAgg.draw()
or self._canvas.draw()
- however this would then make it incompatible with the older versions of matplotlib I imagine.
After this the gui tool works for me!
Thanks @njcuk9999, I implemented this fix.
I cannot seem to run
jwst-coronagraph-visibility-gui
I have tried installing on two (linux) systems using the astroconda
4.6.7
and anaconda version 1.6.9 on system 14.5.12
anaconda version:1.7.2
on system 2Seems to be a problem importing
NavigationToolbar2TkAgg
frommatplotlib.backends.backend_tkagg
version of matplotlib on both systems is
3.1.1
, so I guess they have moved something since the last version ofjwst_coronagraph_visibility
was tested? (Note inmatploliblib.backends.backend_tkagg
they do haveNavigationToolbar2Tk
so maybe this is a simple fix?)Full traceback is below:
System information
System 1:
System 2