PERF: Don't build an AssetFinder if no engine is provided

This is an optimization where we're building an environment but not
using its finder.  Ideally, the consumer would use just the calendar,
but it's not fully featured quite yet.
This commit is contained in:
Richard Frank
2015-10-02 11:53:04 -04:00
parent e8c5203e31
commit a30c4fc689
+4 -1
View File
@@ -121,7 +121,10 @@ class TradingEnvironment(object):
else:
self.engine = engine = asset_db_path
self.asset_finder = AssetFinder(engine)
if engine is not None:
self.asset_finder = AssetFinder(engine)
else:
self.asset_finder = None
def write_data(self,
engine=None,