mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-04 12:45:06 +08:00
Merge pull request #1812 from quantopian/google-finance-for-benchmarking
BUG/MAINT: Switch over to Google for benchmarking
This commit is contained in:
Binary file not shown.
@@ -5,6 +5,7 @@ import shutil
|
||||
import tarfile
|
||||
|
||||
import click
|
||||
import matplotlib
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
|
||||
@@ -14,6 +15,8 @@ from zipline.testing import test_resource_path, tmp_dir
|
||||
from zipline.utils.cache import dataframe_cache
|
||||
|
||||
|
||||
matplotlib.use('Agg')
|
||||
|
||||
INPUT_DATA_START_DATE = pd.Timestamp('2004-01-02')
|
||||
INPUT_DATA_END_DATE = pd.Timestamp('2014-12-31')
|
||||
INPUT_DATA_SYMBOLS = (
|
||||
|
||||
@@ -385,7 +385,7 @@ class TestRisk(WithTradingEnvironment, ZiplineTestCase):
|
||||
def test_partial_month(self):
|
||||
|
||||
start_session = self.trading_calendar.minute_to_session_label(
|
||||
pd.Timestamp("1991-01-01", tz='UTC')
|
||||
pd.Timestamp("1993-02-01", tz='UTC')
|
||||
)
|
||||
|
||||
# 1992 and 1996 were leap years
|
||||
|
||||
@@ -21,11 +21,12 @@ import pandas as pd
|
||||
|
||||
from zipline import examples
|
||||
from zipline.data.bundles import register, unregister
|
||||
from zipline.testing import test_resource_path, copy_market_data
|
||||
from zipline.testing.fixtures import WithTmpDir, ZiplineTestCase, \
|
||||
WithTradingEnvironment
|
||||
from zipline.testing import test_resource_path
|
||||
from zipline.testing.fixtures import WithTmpDir, ZiplineTestCase
|
||||
from zipline.testing.predicates import assert_equal
|
||||
from zipline.utils.cache import dataframe_cache
|
||||
from zipline.utils.paths import ensure_file
|
||||
|
||||
|
||||
# Otherwise the next line sometimes complains about being run too late.
|
||||
_multiprocess_can_split_ = False
|
||||
@@ -54,10 +55,11 @@ class ExamplesTests(WithTmpDir, ZiplineTestCase):
|
||||
serialization='pickle',
|
||||
)
|
||||
|
||||
copy_market_data(WithTradingEnvironment.MARKET_DATA_DIR,
|
||||
cls.tmpdir.getpath('example_data/root'))
|
||||
market_data = ('SPY_benchmark.csv', 'treasury_curves.csv')
|
||||
for data in market_data:
|
||||
ensure_file(cls.tmpdir.getpath('example_data/root/data/' + data))
|
||||
|
||||
@parameterized.expand(examples.EXAMPLE_MODULES)
|
||||
@parameterized.expand(sorted(examples.EXAMPLE_MODULES))
|
||||
def test_example(self, example_name):
|
||||
actual_perf = examples.run_example(
|
||||
example_name,
|
||||
|
||||
Reference in New Issue
Block a user