# Buggy code
def __init__(
    self,
    signal1D,
    auto_background=True,
    auto_add_edges=True,
    ll=None,
    GOS=None,
    dictionary=None,
):
    Model1D.__init__(self, signal1D)
    self._suspend_auto_fine_structure_width = False
    self.convolved = False
    self.low_loss = ll
    self.GOS = GOS
    self.edges = []
    self._background_components = []
    if dictionary is not None:
        auto_background = False
        auto_add_edges = False
        self._load_dictionary(dictionary)

    if auto_background is True:
        background = PowerLaw()
        self.append(background)

    if self.signal.subshells and auto_add_edges is True:
        self._add_edges_from_subshells_names()


# Traceback (AttributeError)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-21-23a6348573b8> in <module>()
----> 1 m = s.create_model()

/home/magnunor/Documents/HyperSpy/hyperspy/hyperspy/_signals/eels.py in create_model(self, ll, auto_background, auto_add_edges, GOS, dictionary)
   1252                           auto_background=auto_background,
   1253                           auto_add_edges=auto_add_edges,
-> 1254                           GOS=GOS,
   1255                           dictionary=dictionary)
   1256         return model

/home/magnunor/Documents/HyperSpy/hyperspy/hyperspy/models/eelsmodel.py in __init__(self, signal1D, auto_background, auto_add_edges, ll, GOS, dictionary)
     91 
     92         if self.signal.subshells and auto_add_edges is True:
---> 93             self._add_edges_from_subshells_names()
     94 
     95     @property

/home/magnunor/Documents/HyperSpy/hyperspy/hyperspy/models/eelsmodel.py in _add_edges_from_subshells_names(self, e_shells)
    190         # we reassing the value of self.GOS
    191         self.GOS = master_edge.GOS._name
--> 192         self.append(master_edge)
    193         element = master_edge.element
    194         while len(e_shells) > 0:

/home/magnunor/Documents/HyperSpy/hyperspy/hyperspy/models/eelsmodel.py in append(self, component)
    111         super(EELSModel, self).append(component)
    112         if isinstance(component, EELSCLEdge):
--> 113             tem = self.signal.metadata.Acquisition_instrument.TEM
    114             component.set_microscope_parameters(
    115                 E0=tem.beam_energy,

/home/magnunor/Documents/HyperSpy/hyperspy/hyperspy/misc/utils.py in __getattribute__(self, name)
    333             name = name.decode()
    334         name = slugify(name, valid_variable_name=True)
--> 335         item = super(DictionaryTreeBrowser, self).__getattribute__(name)
    336         if isinstance(item, dict) and '_dtb_value_' in item and "key" in item:
    337             return item['_dtb_value_']

AttributeError: 'DictionaryTreeBrowser' object has no attribute 'Acquisition_instrument'

# Fixed code
def __init__(
    self,
    signal1D,
    auto_background=True,
    auto_add_edges=True,
    ll=None,
    GOS=None,
    dictionary=None,
):
    Model1D.__init__(self, signal1D)
    self.signal1D = signal1D
    self._suspend_auto_fine_structure_width = False
    self.convolved = False
    self.low_loss = ll
    self.GOS = GOS
    self.edges = []
    self._background_components = []
    if dictionary is not None:
        auto_background = False
        auto_add_edges = False
        self._load_dictionary(dictionary)

    if auto_background is True:
        background = PowerLaw()
        self.append(background)

    if self.signal.subshells and auto_add_edges is True:
        self._add_edges_from_subshells_names()