Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
fix(base): fix dump yaml kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhxiao committed Jul 19, 2019
1 parent 7ab0fdb commit 1b52683
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gnes/base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def arg_wrapper(self, *args, **kwargs):
taboo = {'self', 'args', 'kwargs'}
taboo.update(TrainableType.default_gnes_config.keys())
all_pars = inspect.signature(func).parameters
tmp = {k: v.default for k, v in all_pars.items()}
tmp = {k: v.default for k, v in all_pars.items() if k not in taboo}
tmp_list = [k for k in all_pars.keys() if k not in taboo]
# set args by aligning tmp_list with arg values
for k, v in zip(tmp_list, args):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def tearDown(self):
if os.path.exists(self.dump_path):
os.remove(self.dump_path)

def test_siganature(self):
def test_signature(self):
a = foo1(2)
self.assertEqual(a._init_kwargs_dict, {'a': 2, 'b': 1})
a = foo2(2, 3, 3)
Expand Down

0 comments on commit 1b52683

Please sign in to comment.