ssciwr/AMMICO

No usefull error message when not providing any files.

Closed this issue · 1 comments

When I ran the facial_expression notebook without changing the file path the find_files function returned no error or warning.

only the explore_analysis function finally throw an exception:


KeyError                                  Traceback (most recent call last)
[/home/gwydion/SSC/missinformation/AMMICO/notebooks/facial_expressions.ipynb](https://file+.vscode-resource.vscode-cdn.net/home/gwydion/SSC/missinformation/AMMICO/notebooks/facial_expressions.ipynb) Cell 12 in ()
----> [1](vscode-notebook-cell:/home/gwydion/SSC/missinformation/AMMICO/notebooks/facial_expressions.ipynb#X14sZmlsZQ%3D%3D?line=0) mdisplay.explore_analysis(mydict, identify="faces")

File [~/SSC/missinformation/AMMICO/misinformation/display.py:72](https://file+.vscode-resource.vscode-cdn.net/home/gwydion/SSC/missinformation/AMMICO/notebooks/~/SSC/missinformation/AMMICO/misinformation/display.py:72), in explore_analysis(mydict, identify)
     70 # Register the handler and trigger it immediately
     71 image_select.observe(switch, names=("value",), type="change")
---> 72 switch(None)
     74 # Show the combined widget
     75 return ipywidgets.HBox([image_select, image_widget, output])

File [~/SSC/missinformation/AMMICO/misinformation/display.py:58](https://file+.vscode-resource.vscode-cdn.net/home/gwydion/SSC/missinformation/AMMICO/notebooks/~/SSC/missinformation/AMMICO/misinformation/display.py:58), in explore_analysis..switch(_)
     54 output.clear_output()
     56 # Create the new content
     57 image_widget.children = (
---> 58     ipywidgets.Image.from_file(mydict[image_select.value]["filename"]),
     59 )
     61 # This output widget absorbes print statements that are messing with
     62 # the widget output and cannot be disabled through the API.
     63 with faces.NocatchOutput():

KeyError: None

Current error message in initilize_dict:


Traceback (most recent call last):
  File "/home/gwydion/SSC/missinformation/AMMICO/ammico/testing_all.py", line 11, in <module>
    outdict = ammico.append_data_to_dict(mydict)
  File "/home/gwydion/anaconda3/envs/test_ammico/lib/python3.10/site-packages/ammico/utils.py", line 92, in append_data_to_dict
    outdict = {key: [] for key in list(mydict.values())[0].keys()}
IndexError: list index out of range