brands-d / kMap

kMap.py is a python based program for simulation and data analysis in photoemission tomography.
GNU General Public License v3.0
23 stars 9 forks source link

Colormaps could not be loaded #29

Closed tromask closed 3 years ago

tromask commented 4 years ago

Error while run the current dev version on Windows 10, 20H2 C:\resources\misc\colormaps.json\colormaps_default.json is not found

(base) C:\Users\admin\Programs\kMap>python -m kmap
2020/11/25-10:13:50-kmap-ERROR  Colormaps could not be loaded
2020/11/25-10:13:50-kmap-ERROR  Traceback (most recent call last):
  File "C:\Users\admin\Programs\kMap\kmap\controller\colormap.py", line 42, in load_colormaps
    self.model.load_colormaps(self.path)
  File "C:\Users\admin\Programs\kMap\kmap\model\colormap_model.py", line 24, in load_colormaps
    with open(path, 'r') as file:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\resources\\misc\\colormaps.json\\colormaps_default.json'

Traceback (most recent call last):
  File "C:\Users\admin\Programs\kMap\kmap\controller\mainwindow.py", line 183, in open_orbital_data_tab
    self.tab_widget.open_orbital_data_tab()
  File "C:\Users\admin\Programs\kMap\kmap\controller\tabwidget.py", line 109, in open_orbital_data_tab
    tab = OrbitalDataTab()
  File "C:\Users\admin\Programs\kMap\kmap\controller\orbitaldatatab.py", line 37, in __init__
    self._setup()
  File "C:\Users\admin\Programs\kMap\kmap\controller\orbitaldatatab.py", line 242, in _setup
    self.colormap = Colormap([self.plot_item])
  File "C:\Users\admin\Programs\kMap\kmap\controller\colormap.py", line 37, in __init__
    self.load_colormaps()
  File "C:\Users\admin\Programs\kMap\kmap\controller\colormap.py", line 52, in load_colormaps
    self.set_default_colormap()
  File "C:\Users\admin\Programs\kMap\kmap\controller\colormap.py", line 114, in set_default_colormap
    self.set_colormap(default_colormap)
  File "C:\Users\admin\Programs\kMap\kmap\controller\colormap.py", line 108, in set_colormap
    self.model.set_current_colormap(name)
  File "C:\Users\admin\Programs\kMap\kmap\model\colormap_model.py", line 81, in set_current_colormap
    index = self._name_to_index(name)
  File "C:\Users\admin\Programs\kMap\kmap\model\colormap_model.py", line 91, in _name_to_index
    index = name_list.index(name)
ValueError: 'standard' is not in list
tromask commented 4 years ago

No error after changing the colormap path to default in general settings

brands-d commented 3 years ago

I can not really reproduce this bug but commit b6a1288 is a small update to the colormaps. If the bug persists can you please send me or post your settings (Preferences -> General Settings -> Edit User: Copy the content).

tromask commented 3 years ago

You may close this issue. I don't have such problems any more with "colormap=resources\misc" in User Settings.