def __str__(self): names = ['name'] names.extend(get_keyword_names(self._optfunc)) #names.remove('full_output') # Add the method's name to printed output # Don't add to self.config b/c name isn't a # fit function config setting add_name_config = {} add_name_config['name'] = self.name add_name_config.update(self.config) return print_fields(names, add_name_config)
def __str__(self): names = ['name'] names.extend(get_keyword_names(self._optfunc)) #names.remove('full_output') # Add the method's name to printed output # Don't add to self.config b/c name isn't a # fit function config setting add_name_config = {} add_name_config['name'] = self.name add_name_config.update(self.config) return print_fields(names, add_name_config)
def test_get_keyword_names(self): self.assertEqual(utils.get_keyword_names(self.f1), []) l = ['b', 'c', 'd', 'e'] self.assertEqual(utils.get_keyword_names(self.f2), l) self.assertEqual(utils.get_keyword_names(self.f2, 2), l[2:]) self.assertEqual(utils.get_keyword_names(self.f2, 7), []) l = ['a', 'b', 'c', 'd', 'e'] self.assertEqual(utils.get_keyword_names(self.f3), l) self.assertEqual(utils.get_keyword_names(self.f3, 1), l[1:]) self.assertEqual(utils.get_keyword_names(self.f3, 7), [])
def test_get_keyword_names(self): self.assertEqual(utils.get_keyword_names(self.f1), []) l = ['b', 'c', 'd', 'e'] self.assertEqual(utils.get_keyword_names(self.f2), l) self.assertEqual(utils.get_keyword_names(self.f2, 2), l[2:]) self.assertEqual(utils.get_keyword_names(self.f2, 7), []) l = ['a', 'b', 'c', 'd', 'e'] self.assertEqual(utils.get_keyword_names(self.f3), l) self.assertEqual(utils.get_keyword_names(self.f3, 1), l[1:]) self.assertEqual(utils.get_keyword_names(self.f3, 7), [])
def test_get_keyword_names_f3(): l = ['a', 'b', 'c', 'd', 'e'] assert utils.get_keyword_names(f3) == l assert utils.get_keyword_names(f3, 1) == l[1:] assert utils.get_keyword_names(f3, 7) == []
def test_get_keyword_names_f2(): l = ['b', 'c', 'd', 'e'] assert utils.get_keyword_names(f2) == l assert utils.get_keyword_names(f2, 2) == l[2:] assert utils.get_keyword_names(f2, 7) == []
def test_get_keyword_names_f1(): assert utils.get_keyword_names(f1) == []