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

Genetic algorithm to fine tune strategy parameters #598

Merged
merged 1 commit into from
Oct 7, 2017
Merged

Genetic algorithm to fine tune strategy parameters #598

merged 1 commit into from
Oct 7, 2017

Conversation

DeviaVir
Copy link
Owner

@DeviaVir DeviaVir commented Oct 6, 2017

Since #299 has stalled for quite a while now, I grabbed the code and put it in the scripts/ dir, so it'll be easier for other devs to keep working on it. In its current state, the code has unfortunately decayed quite a bit.

Please review:

Copy link
Contributor

@crubb crubb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! I'd recommend extending README.md with links to the original Github issue, PR and this one with the warning, that the code decayed quite a bit.


def args_for_strategy(strat):
available = subprocess.check_output(shlex.split('/app/zenbot.sh list-strategies'))
strats = [strat.strip() for strat in available.split(b'\n\n')]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import re

ansi_escape = re.compile(b'\x1b[^m]*m')
available = subprocess.check_output(shlex.split('/app/zenbot.sh list-strategies'))
strats = [ansi_escape.sub(b'', strat.strip()) for strat in available.split(b'\n\n')]

Could I propose these lines to get rid of ANSI escape sequences? otherwise it seems to me that this function is not able to parse correctly command options. NB: I'm using python scripts outside docker container.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

@DeviaVir DeviaVir merged commit b7fc267 into DeviaVir:master Oct 7, 2017
@DeviaVir DeviaVir deleted the genetic_algo branch October 7, 2017 23:11
emabo pushed a commit to emabo/zenbot that referenced this pull request Oct 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants