Skip to content

Commit

Permalink
rename template configs
Browse files Browse the repository at this point in the history
add func strip_config()
  • Loading branch information
enarjord committed Sep 9, 2022
1 parent 51c566c commit ac4f910
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pure_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ def get_template_live_config(passivbot_mode="static_grid"):
elif passivbot_mode == "neat_grid":
return sort_dict_keys(
{
"config_name": "template",
"config_name": "neat_template",
"logging_level": 0,
"long": {
"enabled": True,
Expand Down Expand Up @@ -500,7 +500,7 @@ def get_template_live_config(passivbot_mode="static_grid"):
)
return sort_dict_keys(
{
"config_name": "template",
"config_name": "static_template",
"logging_level": 0,
"long": {
"enabled": True,
Expand Down Expand Up @@ -1118,3 +1118,12 @@ def make_compatible(live_config_: dict) -> dict:
return sort_dict_keys(live_config)
assert all(k in live_config["long"] for k in get_template_live_config()["long"])
return live_config


def strip_config(cfg: dict) -> dict:
pm = determine_passivbot_mode(cfg)
template = get_template_live_config(pm)
for k in template["long"]:
template["long"][k] = cfg["long"][k]
template["short"][k] = cfg["short"][k]
return template

0 comments on commit ac4f910

Please sign in to comment.