# 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
            raise AttributeError(msg)
        if isinstance(item, MethodParameter):
            # make sure MethodParameters defined with the class
            # are bound to this Alloy
            return item.bind(alloy=self)
        else:
            return item

    def __str__(self):
        return self.name
    
#     def __repr__(self):
#         return self.name
    
    def latex(self):
        '''
        Returns a LaTeX representation of the alloy.
        '''
        raise NotImplementedError()

    def element_fraction(self, element):
        '''
        Returns the atomic fraction of the given ``element``.
        '''
        raise NotImplementedError()

    def _add_parameter(self, parameter):
        '''
        Force adds a `Parameter` object to the instance.
        '''

# 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

            raise AttributeError(msg)
        if isinstance(item, MethodParameter):
            # make sure MethodParameters defined with the class
            # are bound to this Alloy
            return item.bind(alloy=self)
        else:
            return item

    def __str__(self):
        return self.name
    
#     def __repr__(self):
#         return self.name
    
    def latex(self):
        '''
        Returns a LaTeX representation of the alloy.
        '''
        raise NotImplementedError()

    def element_fraction(self, element):
        '''
        Returns the atomic fraction of the given ``element``.
        '''
        raise NotImplementedError()

    def _add_parameter(self, parameter):
        '''
        Force adds a `Parameter` object to the instance.
        '''

        if isinstance(parameter, MethodParameter):