mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-11 11:16:15 +08:00
MAINT: Removes the ability to reference a global TradingEnvironment
This commit removes the ability to reference a shared TradingEnvironment through the zipline.finance.trading module. In place, the classes that require a TradingEnvironment, or its child AssetFinder, contain their own references to those objects. This commit also adds serialization utilities that allow for the pickling/unpickling of objects without unintentionally their TradingEnvironments or AssetFinders.
This commit is contained in:
@@ -31,8 +31,6 @@ from zipline.utils import parse_args, run_pipeline
|
||||
# Otherwise the next line sometimes complains about being run too late.
|
||||
_multiprocess_can_split_ = False
|
||||
|
||||
from zipline.finance import trading
|
||||
|
||||
matplotlib.use('Agg')
|
||||
|
||||
|
||||
@@ -47,8 +45,6 @@ class ExamplesTests(TestCase):
|
||||
@parameterized.expand(((os.path.basename(f).replace('.', '_'), f) for f in
|
||||
glob.glob(os.path.join(example_dir(), '*.py'))))
|
||||
def test_example(self, name, example):
|
||||
# Create a new trading environment for each test.
|
||||
trading.environment = trading.TradingEnvironment()
|
||||
imp.load_source('__main__', os.path.basename(example), open(example))
|
||||
|
||||
# Test algorithm as if scripts/run_algo.py is being used.
|
||||
|
||||
Reference in New Issue
Block a user