Skip to content

Commit

Permalink
⚡ kwargs merge dictionaries instead of using loops
Browse files Browse the repository at this point in the history
  • Loading branch information
Rikj000 committed Jun 17, 2021
1 parent 546ca01 commit 1567804
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions freqtrade/optimize/hyperopt_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,9 @@ def _params_update_for_json(result_dict, params, non_optimized, space: str) -> N
space_non_optimized = HyperoptTools._space_params(non_optimized, space)
all_space_params = space_params

# Include non optimized params if there are any
# Merge non optimized params if there are any
if len(space_non_optimized) > 0:
for non_optimized_param in space_non_optimized:
if non_optimized_param not in all_space_params:
all_space_params[non_optimized_param] = \
space_non_optimized[non_optimized_param]
all_space_params = {**space_non_optimized, **space_params}

if space in ['buy', 'sell']:
result_dict.setdefault('params', {}).update(all_space_params)
Expand Down

0 comments on commit 1567804

Please sign in to comment.