Skip to content

Commit

Permalink
Merge pull request #88 from felix5572/master
Browse files Browse the repository at this point in the history
fix bug Resources load_from_dict duplicated kwargs
  • Loading branch information
felix5572 committed Jul 6, 2021
2 parents 9f66a5d + 0fbcc76 commit 2907e7c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions dpdispatcher/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,14 +689,15 @@ def deserialize(cls, resources_dict):
queue_name=resources_dict['queue_name'],
group_size=resources_dict['group_size'],

custom_flags=resources_dict['custom_flags'],
strategy=resources_dict['strategy'],
para_deg=resources_dict['para_deg'],
module_unload_list=resources_dict['module_unload_list'],
module_list=resources_dict['module_list'],
source_list=resources_dict['source_list'],
envs=resources_dict['envs'],
**resources_dict['kwargs'])
custom_flags=resources_dict.get('custom_flags', []),
strategy=resources_dict.get('strategy', default_strategy),
para_deg=resources_dict.get('para_deg', 1),
module_unload_list=resources_dict.get('module_unload_list', []),
module_list=resources_dict.get('module_list', []),
source_list=resources_dict.get('source_list', []),
envs=resources_dict.get('envs', {}),
**resources_dict.get('kwargs', {})
)
return resources

@classmethod
Expand All @@ -708,8 +709,7 @@ def load_from_json(cls, json_file):

@classmethod
def load_from_dict(cls, resources_dict):

return cls(**resources_dict)
return cls.deserialize(resources_dict=resources_dict)

@staticmethod
def arginfo():
Expand Down

0 comments on commit 2907e7c

Please sign in to comment.