Skip to content

Commit

Permalink
add submodule attributes to base
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshnielsen committed Jun 22, 2017
1 parent 4a0f135 commit 354b3cd
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions qcodes/instrument/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,14 @@ def print_readable_snapshot(self, update=False, max_chars=80):
submodule.print_readable_snapshot(update, max_chars)

#
# shortcuts to parameters & setters & getters #
# shortcuts to parameters & setters & getters #
#
# instrument['someparam'] === instrument.parameters['someparam'] #
# instrument.someparam === instrument.parameters['someparam'] #
# instrument.get('someparam') === instrument['someparam'].get() #
# etc... #
#
delegate_attr_dicts = ['parameters', 'functions']
delegate_attr_dicts = ['parameters', 'functions', 'submodules']

def __getitem__(self, key):
"""Delegate instrument['name'] to parameter or function 'name'."""
Expand Down Expand Up @@ -596,6 +596,3 @@ def ask_raw(self, cmd):
raise NotImplementedError(
'Instrument {} has not defined an ask method'.format(
type(self).__name__))

delegate_attr_dicts = ['parameters', 'functions', 'submodules']

0 comments on commit 354b3cd

Please sign in to comment.