<commit_before>from lmfit.ui import Fitter

class FitterWithAttributeAccess(Fitter):
    def __getattr__(self, attr):
        if attr.endswith('_error'):
            name = attr[:-len('_error')]
            try:
                return self.current_result.params[name].stderr
            except KeyError:
                raise AttributeError("couldn't find error for %s in self.current_result" % name)
        try:
            return self.current_params[attr].value
        except KeyError:
            raise AttributeError("'{}' object has no attribute '{}'".format(self.__class__.__name__, attr))

    def __dir__(self):
        return (dir(super(Fitter, self)) +
                self.__dict__.keys() +
                self.current_params.keys() +
                [name + '_error' for name in self.current_params.keys()])<commit_msg>fix for tab completion on fitter class<commit_after>from lmfit.ui import Fitter

class FitterWithAttributeAccess(Fitter):
    def __getattr__(self, attr):
        if attr.endswith('_error'):
            name = attr[:-len('_error')]
            try:
                return self.current_result.params[name].stderr
            except KeyError:
                raise AttributeError("couldn't find error for %s in self.current_result" % name)
        try:
            return self.current_params[attr].value
        except KeyError:
            raise AttributeError("'{}' object has no attribute '{}'".format(self.__class__.__name__, attr))

    def __dir__(self):
        return sorted(set(dir(Fitter) +
                self.__dict__.keys() +
                self.current_params.keys() +
                [name + '_error' for name in self.current_params.keys()]))
{'fraction_non_alphanumeric': 0.11176818450620934, 'fraction_numerical': 0.0, 'mean_word_length': 2.2413793103448274, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4106679', 'n_tokens_mistral': 471, 'n_tokens_neox': 454, 'n_words': 110}