def compare(self, other, name='self', ignore_list=None):
    'Compare two objects and return list of differences'
    if (ignore_list is None):
        ignore_list = list()
    if (type(other) != type(self)):
        return [(('type(' + name) + ')')]
    diff_list = list()
    if (((other.mat_type is None) and (self.mat_type is not None)) or ((other.mat_type is not None) and (self.mat_type is None))):
        diff_list.append((name + '.mat_type None mismatch'))
    elif (self.mat_type is not None):
        diff_list.extend(self.mat_type.compare(other.mat_type, name=(name + '.mat_type')))
    if (other._type_magnetization != self._type_magnetization):
        diff_list.append((name + '.type_magnetization'))
    if (other._Lmag != self._Lmag):
        diff_list.append((name + '.Lmag'))
    diff_list = list(filter((lambda x: (x not in ignore_list)), diff_list))
    return diff_list
Compare two objects and return list of differences
def compare(self, other, name='self', ignore_list=None):
    
    if (ignore_list is None):
        ignore_list = list()
    if (type(other) != type(self)):
        return [(('type(' + name) + ')')]
    diff_list = list()
    if (((other.mat_type is None) and (self.mat_type is not None)) or ((other.mat_type is not None) and (self.mat_type is None))):
        diff_list.append((name + '.mat_type None mismatch'))
    elif (self.mat_type is not None):
        diff_list.extend(self.mat_type.compare(other.mat_type, name=(name + '.mat_type')))
    if (other._type_magnetization != self._type_magnetization):
        diff_list.append((name + '.type_magnetization'))
    if (other._Lmag != self._Lmag):
        diff_list.append((name + '.Lmag'))
    diff_list = list(filter((lambda x: (x not in ignore_list)), diff_list))
    return diff_list