# Path: src/openbandparams/parameter.py
# class Parameter(object):
#     def __init__(self, name, units, aliases=[], references=[]):
#         '''
#         Parameters
#         ----------
#         name : string
#             name of the parameter
#         units : string
#             units
#         aliases : list of strings (default=[])
#             list of alternate names
#         references : list of Reference objects (default=[])
#             literature references
#         '''
#         self.name = name
#         self.description = descriptions.get(name, '')
#         self.units = units
#         self.aliases = aliases
#         self._references = references
#     
#     def __call__(self, *args, **kwargs):
#         raise NotImplementedError()
# 
#     def get_references(self):
#         return self._references
# 
# class MethodParameter(Parameter):
#     def __init__(self, name, method, dependencies, units,
#                  aliases=[], references=[]):
#         '''
#         Parameters
#         ----------
#         name : string
#             name of the parameter
#         method : callable method (default=None)
#             method that accepts the alloy object as the first parameter, and
#             returns the value of the parameter
#         dependencies : list of strings (default=None)
#             list of parameter names that this parameter depends on
#         units : string
#             units
#         aliases : list of strings (default=[])
#             list of alternate names
#         references : list of Reference objects (default=[])
#             literature references
#         '''
#         super(MethodParameter, self).__init__(name=name,
#                                               units=units,
#                                               aliases=aliases,
#                                               references=references)
#         self.alloy = None
#         self.method = method
#         self.dependencies = dependencies
#     
#     def bind(self, alloy):
#         '''
#         Shallow copies this MethodParameter, and binds it to an alloy.
#         This is required before calling.
#         '''
#         param = MethodParameter(self.name, self.method, self.dependencies,
#                                 self.units, self.aliases, self._references)
#         param.alloy = alloy
#         return param
#     
#     def __call__(self, *args, **kwargs):
#         if self.alloy is None:
#             raise TypeError('MethodParameter must be bound to an Alloy'
#                             ' with `bind` before calling.')
#         return self.method(self.alloy, *args, **kwargs)
#     
#     def get_references(self):
#         if self.alloy is None:
#             return self._references
#         else:
#             params = [self]
#             refs = []
#             refs.extend(self._references)
#             for d in self.dependencies:
#                 p = self.alloy.get_parameter(d, default=None)
#                 if p is not None and p not in params:
#                     params.append(p)
#                     for ref in p.get_references():
#                         if ref not in refs:
#                             refs.append(ref)
#             if hasattr(self.alloy, 'binaries'):
#                 for alloy in getattr(self.alloy, 'binaries'):
#                     for d in self.dependencies:
#                         p = alloy.get_parameter(d, default=None)
#                         if p is not None and p not in params:
#                             params.append(p)
#                             for ref in p.get_references():
#                                 if ref not in refs:
#                                     refs.append(ref)
#             if hasattr(self.alloy, 'ternaries'):
#                 for alloy in getattr(self.alloy, 'ternaries'):
#                     for d in self.dependencies:
#                         p = alloy.get_parameter(d, default=None)
#                         params.append(p)
#                         if p is not None and p not in params:
#                             for ref in p.get_references():
#                                 if ref not in refs:
#                                     refs.append(ref)
#             return refs


from .parameter import Parameter, MethodParameter
        if parameter.name in self._parameters and not overload:
            raise ValueError('Parameter "{}" has already been added'
                             ' and overload is False.'
                             ''.format(parameter.name))
        for alias in parameter.aliases:
            if alias in self._aliases and not overload:
                raise ValueError('Alias "{}" has already been added'
                                 ' and overload is False.'
                                 ''.format(parameter.name))
        self._add_parameter(parameter)
    
    def set_parameter(self, parameter):
        '''
        Same as calling ``add_parameter`` with ``overload=True``
        '''
        self.add_parameter(parameter, overload=True)
    
    def has_parameter(self, name):
        '''
        Returns True if the named parameter is present, or False, otherwise.
        '''
        return self.get_parameter(name, default=None) is not None
    
    def get_parameter(self, name, default=None):
        '''
        Returns the named parameter if present, or the value of `default`,
        otherwise.
        '''
        if hasattr(self, name):
            item = getattr(self, name)

# Path: src/openbandparams/parameter.py
# class Parameter(object):
#     def __init__(self, name, units, aliases=[], references=[]):
#         '''
#         Parameters
#         ----------
#         name : string
#             name of the parameter
#         units : string
#             units
#         aliases : list of strings (default=[])
#             list of alternate names
#         references : list of Reference objects (default=[])
#             literature references
#         '''
#         self.name = name
#         self.description = descriptions.get(name, '')
#         self.units = units
#         self.aliases = aliases
#         self._references = references
#     
#     def __call__(self, *args, **kwargs):
#         raise NotImplementedError()
# 
#     def get_references(self):
#         return self._references
# 
# class MethodParameter(Parameter):
#     def __init__(self, name, method, dependencies, units,
#                  aliases=[], references=[]):
#         '''
#         Parameters
#         ----------
#         name : string
#             name of the parameter
#         method : callable method (default=None)
#             method that accepts the alloy object as the first parameter, and
#             returns the value of the parameter
#         dependencies : list of strings (default=None)
#             list of parameter names that this parameter depends on
#         units : string
#             units
#         aliases : list of strings (default=[])
#             list of alternate names
#         references : list of Reference objects (default=[])
#             literature references
#         '''
#         super(MethodParameter, self).__init__(name=name,
#                                               units=units,
#                                               aliases=aliases,
#                                               references=references)
#         self.alloy = None
#         self.method = method
#         self.dependencies = dependencies
#     
#     def bind(self, alloy):
#         '''
#         Shallow copies this MethodParameter, and binds it to an alloy.
#         This is required before calling.
#         '''
#         param = MethodParameter(self.name, self.method, self.dependencies,
#                                 self.units, self.aliases, self._references)
#         param.alloy = alloy
#         return param
#     
#     def __call__(self, *args, **kwargs):
#         if self.alloy is None:
#             raise TypeError('MethodParameter must be bound to an Alloy'
#                             ' with `bind` before calling.')
#         return self.method(self.alloy, *args, **kwargs)
#     
#     def get_references(self):
#         if self.alloy is None:
#             return self._references
#         else:
#             params = [self]
#             refs = []
#             refs.extend(self._references)
#             for d in self.dependencies:
#                 p = self.alloy.get_parameter(d, default=None)
#                 if p is not None and p not in params:
#                     params.append(p)
#                     for ref in p.get_references():
#                         if ref not in refs:
#                             refs.append(ref)
#             if hasattr(self.alloy, 'binaries'):
#                 for alloy in getattr(self.alloy, 'binaries'):
#                     for d in self.dependencies:
#                         p = alloy.get_parameter(d, default=None)
#                         if p is not None and p not in params:
#                             params.append(p)
#                             for ref in p.get_references():
#                                 if ref not in refs:
#                                     refs.append(ref)
#             if hasattr(self.alloy, 'ternaries'):
#                 for alloy in getattr(self.alloy, 'ternaries'):
#                     for d in self.dependencies:
#                         p = alloy.get_parameter(d, default=None)
#                         params.append(p)
#                         if p is not None and p not in params:
#                             for ref in p.get_references():
#                                 if ref not in refs:
#                                     refs.append(ref)
#             return refs


# Path: src/openbandparams/alloy.py
from .parameter import Parameter, MethodParameter

        if parameter.name in self._parameters and not overload:
            raise ValueError('Parameter "{}" has already been added'
                             ' and overload is False.'
                             ''.format(parameter.name))
        for alias in parameter.aliases:
            if alias in self._aliases and not overload:
                raise ValueError('Alias "{}" has already been added'
                                 ' and overload is False.'
                                 ''.format(parameter.name))
        self._add_parameter(parameter)
    
    def set_parameter(self, parameter):
        '''
        Same as calling ``add_parameter`` with ``overload=True``
        '''
        self.add_parameter(parameter, overload=True)
    
    def has_parameter(self, name):
        '''
        Returns True if the named parameter is present, or False, otherwise.
        '''
        return self.get_parameter(name, default=None) is not None
    
    def get_parameter(self, name, default=None):
        '''
        Returns the named parameter if present, or the value of `default`,
        otherwise.
        '''
        if hasattr(self, name):
            item = getattr(self, name)

            if isinstance(item, Parameter):