mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-11 11:16:15 +08:00
TST: Add logging of sim params for perf tracker tests.
These tests use the random simulation parameters, which is leading to an intermittent failure. We may want to consider removing the randomness, but in the meantime the randomness is exposing a case where the cost basis is not the value expected, so logging the sim parameter values to help track down what parameters cause the failure.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
|
||||
import collections
|
||||
import heapq
|
||||
import logging
|
||||
import operator
|
||||
|
||||
import unittest
|
||||
@@ -37,6 +38,8 @@ from zipline.utils.factory import create_random_simulation_parameters
|
||||
import zipline.protocol
|
||||
from zipline.protocol import Event
|
||||
|
||||
logger = logging.getLogger('Test Perf Tracking')
|
||||
|
||||
onesec = datetime.timedelta(seconds=1)
|
||||
oneday = datetime.timedelta(days=1)
|
||||
tradingday = datetime.timedelta(hours=6, minutes=30)
|
||||
@@ -151,6 +154,9 @@ class TestCommissionEvents(unittest.TestCase):
|
||||
self.sim_params, self.dt, self.end_dt = \
|
||||
create_random_simulation_parameters()
|
||||
|
||||
logger.info("sim_params: %s, dt: %s, end_dt: %s" %
|
||||
(self.sim_params, self.dt, self.end_dt))
|
||||
|
||||
self.sim_params.capital_base = 10e3
|
||||
|
||||
self.benchmark_events = benchmark_events_in_range(self.sim_params)
|
||||
|
||||
Reference in New Issue
Block a user