add a little snippet to allow running line_profiler with hyperopt

This commit is contained in:
Janne Sinivirta 2017-11-16 20:21:59 +02:00
parent 27a6b29c80
commit 16d412323c

View File

@ -146,3 +146,8 @@ def test_hyperopt(backtest_conf, backdata, mocker):
print('Best parameters {}'.format(best)) print('Best parameters {}'.format(best))
newlist = sorted(trials.results, key=itemgetter('loss')) newlist = sorted(trials.results, key=itemgetter('loss'))
print('Result: {}'.format(newlist[0]['result'])) print('Result: {}'.format(newlist[0]['result']))
if __name__ == '__main__':
# for profiling with cProfile and line_profiler
pytest.main([__file__, '-s'])