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

Genetic back tester fails to fetch test results because of ansi codes #578

Closed
JensvdHeydt opened this issue Oct 2, 2017 · 3 comments
Closed
Labels

Comments

@JensvdHeydt
Copy link
Contributor

JensvdHeydt commented Oct 2, 2017

There's a problem regarding #577 and the output containing ansi format codes (for colors).

The processOutput function constantly fails with the error message "Bad output detected" because the analysed simulation results contain ansi format codes and the corresponding regex functions to filter the results don't support these.

It's easily fixed with the npm module strip-ansi (https://www.npmjs.com/package/strip-ansi) at line 101 of of darwin.js:

let strippedOutput = StripAnsi(output);
let output2 = strippedOutput.substr(strippedOutput.length - 3500);

and

let StripAnsi = require('strip-ansi');

in the head of the file.

An even better solution would be to introduce a zenbot parameter called "--no-ansi" that would prevent zenbot from even using ansi color codes in it's results in the first place.

Please let me know if you're interested in a small pull request regarding solution 1 or 2.

Cheers,
Jens

@JensvdHeydt JensvdHeydt changed the title Generic back tester fails to fetch test results because of ansi codes Genetic back tester fails to fetch test results because of ansi codes Oct 2, 2017
@JensvdHeydt
Copy link
Contributor Author

just saw that auto_backtester has the same problem

@DeviaVir
Copy link
Owner

DeviaVir commented Oct 2, 2017

Hi @JensvdHeydt, excellent finding and thanks for doing the leg work on finding a solution for it.

I think your suggestion for adding --no-ansi (or perhaps --no-colors) would be the best, and would gladly merge a PR.

@JensvdHeydt
Copy link
Contributor Author

Hi @DeviaVir,

I'll submit a PR shortly. I'm glad I could help

@DeviaVir DeviaVir added the bug label Oct 3, 2017
JensvdHeydt pushed a commit to JensvdHeydt/zenbot that referenced this issue Oct 3, 2017
…be properly interpreted.

The used color.js library does have a "--no-color" switch that should solve the above problem but that library isn't under active development anymore and currently has several bugs regarding the --no-color switch. Since zenbot has a very tight coupling to color.js this is the only way to solve the problem from DeviaVir#578.

Solves: DeviaVir#578
JensvdHeydt pushed a commit to JensvdHeydt/zenbot that referenced this issue Oct 3, 2017
…be properly interpreted. (DeviaVir#578)

The used color.js library does have a "--no-color" switch that should solve the above problem but that library isn't under active development anymore and currently has several bugs regarding the --no-color switch. Since zenbot has a very tight coupling to color.js this is the only way to solve the problem from DeviaVir#578.

Solves: DeviaVir#578
JensvdHeydt pushed a commit to JensvdHeydt/zenbot that referenced this issue Oct 3, 2017
…be properly interpreted. (DeviaVir#578)

The used color.js library does have a "--no-color" switch that should solve the above problem but that library isn't under active development anymore and currently has several bugs regarding the --no-color switch. Since zenbot has a very tight coupling to color.js this is the only way to solve the problem from DeviaVir#578.

Solves: DeviaVir#578
DeviaVir pushed a commit that referenced this issue Oct 3, 2017
…be properly interpreted. (#578) (#581)

The used color.js library does have a "--no-color" switch that should solve the above problem but that library isn't under active development anymore and currently has several bugs regarding the --no-color switch. Since zenbot has a very tight coupling to color.js this is the only way to solve the problem from #578.

Solves: #578
@DeviaVir DeviaVir closed this as completed Oct 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants