Skip to content

Instantly share code, notes, and snippets.

@ngoldbaum
Created March 6, 2015 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ngoldbaum/955b0224728c9b73f9a5 to your computer and use it in GitHub Desktop.
Save ngoldbaum/955b0224728c9b73f9a5 to your computer and use it in GitHub Desktop.
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-13-135b8e8a19a5> in <module>()
2
3 field_dropdown = Dropdown(values=sorted(image_storage['10% Gas Fraction']['DD0000'].keys()))
----> 4 field_dropdown.value = ('gas', 'surface-density')
5
6 sim_control = Dropdown(values=image_storage.keys())
/home/goldbaum/miniconda/lib/python2.7/site-packages/IPython/utils/traitlets.pyc in __set__(self, obj, value)
443 # we explicitly compare silent to True just in case the equality
444 # comparison above returns something other than True/False
--> 445 obj._notify_trait(self.name, old_value, new_value)
446
447 def _validate(self, obj, value):
/home/goldbaum/miniconda/lib/python2.7/site-packages/IPython/html/widgets/widget.pyc in _notify_trait(self, name, old_value, new_value)
371 # registered validation to be processed prior to allowing the widget
372 # machinery to handle the state.
--> 373 LoggingConfigurable._notify_trait(self, name, old_value, new_value)
374
375 # Send the state after the user registered callbacks for trait changes
/home/goldbaum/miniconda/lib/python2.7/site-packages/IPython/utils/traitlets.pyc in _notify_trait(self, name, old_value, new_value)
600 c(name, new_value)
601 elif nargs + offset == 3:
--> 602 c(name, old_value, new_value)
603 else:
604 raise TraitError('a trait changed callback '
/home/goldbaum/miniconda/lib/python2.7/site-packages/IPython/html/widgets/widget_selection.pyc in _value_changed(self, name, old, new)
120 # undo the change, and raise KeyError
121 self.value = old
--> 122 raise KeyError(new)
123 finally:
124 self.value_lock.release()
KeyError: ('gas', 'surface-density')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment