diff --git a/conda/cachetools/bld.bat b/conda/lru-dict/bld.bat similarity index 94% rename from conda/cachetools/bld.bat rename to conda/lru-dict/bld.bat index 87b1481d..fb9a835a 100644 --- a/conda/cachetools/bld.bat +++ b/conda/lru-dict/bld.bat @@ -5,4 +5,4 @@ if errorlevel 1 exit 1 :: See :: http://docs.continuum.io/conda/build.html -:: for a list of environment variables that are set during the build process. +:: for a list of environment variables that are set during the build process. \ No newline at end of file diff --git a/conda/cachetools/build.sh b/conda/lru-dict/build.sh similarity index 94% rename from conda/cachetools/build.sh rename to conda/lru-dict/build.sh index 4d7fc032..68fa87cc 100644 --- a/conda/cachetools/build.sh +++ b/conda/lru-dict/build.sh @@ -6,4 +6,4 @@ $PYTHON setup.py install # See # http://docs.continuum.io/conda/build.html -# for a list of environment variables that are set during the build process. +# for a list of environment variables that are set during the build process. \ No newline at end of file diff --git a/conda/cachetools/meta.yaml b/conda/lru-dict/meta.yaml similarity index 65% rename from conda/cachetools/meta.yaml rename to conda/lru-dict/meta.yaml index 5d571dfb..366c973c 100644 --- a/conda/cachetools/meta.yaml +++ b/conda/lru-dict/meta.yaml @@ -1,11 +1,11 @@ package: - name: cachetools - version: "1.1.6" + name: lru-dict + version: "1.1.4" source: - fn: cachetools-1.1.6.tar.gz - url: https://pypi.python.org/packages/source/c/cachetools/cachetools-1.1.6.tar.gz - md5: 387d7f34effd9335ae55bd0762e77bfa + fn: lru-dict-1.1.4.tar.gz + url: https://files.pythonhosted.org/packages/c3/b7/4e5bcbdfdc2227001f897051d6f4c83f9d236fe89a9df74da07cc3d9bac8/lru-dict-1.1.4.tar.gz + md5: 95ed142416b32c4b03dd8e7dae924f38 # patches: # List any patch files here # - fix.patch @@ -17,9 +17,9 @@ source: # Put any entry points (scripts to be generated automatically) here. The # syntax is module:function. For example # - # - cachetools = cachetools:main + # - lru-dict = lru-dict:main # - # Would create an entry point called cachetools that calls cachetools.main() + # Would create an entry point called lru-dict that calls lru-dict.main() # If this is a new build for the same version, increment the build @@ -37,7 +37,7 @@ requirements: test: # Python imports imports: - - cachetools + - lru # commands: # You can put test commands to be run here. Use this to test that the @@ -52,10 +52,10 @@ test: # - nose about: - home: https://github.com/tkem/cachetools + home: https://github.com/amitdev/lru-dict license: MIT License - summary: 'Extensible memoizing collections and decorators' + summary: 'A fast and memory efficient LRU cache.' # See # http://docs.continuum.io/conda/build.html for -# more information about meta.yaml +# more information about meta.yaml \ No newline at end of file diff --git a/etc/requirements.txt b/etc/requirements.txt index 628d3156..be790dec 100644 --- a/etc/requirements.txt +++ b/etc/requirements.txt @@ -63,7 +63,8 @@ alembic==0.7.7 sortedcontainers==1.4.4 intervaltree==2.1.0 -cachetools==1.1.5 +# for caching +lru-dict==1.1.4 # For financial risk calculations empyrical==0.1.11 diff --git a/zipline/data/history_loader.py b/zipline/data/history_loader.py index a3a135fa..753b1a3f 100644 --- a/zipline/data/history_loader.py +++ b/zipline/data/history_loader.py @@ -17,8 +17,8 @@ from abc import ( abstractmethod, abstractproperty, ) +from lru import LRU -from cachetools import LRUCache from numpy import around, hstack from pandas import Int64Index @@ -89,7 +89,7 @@ class HistoryLoader(with_metaclass(ABCMeta)): self._reader = reader self._adjustments_reader = adjustment_reader self._window_blocks = { - field: ExpiringCache(LRUCache(maxsize=sid_cache_size)) + field: ExpiringCache(LRU(sid_cache_size)) for field in self.FIELDS } diff --git a/zipline/data/minute_bars.py b/zipline/data/minute_bars.py index 893ac5c1..6e43d74c 100644 --- a/zipline/data/minute_bars.py +++ b/zipline/data/minute_bars.py @@ -16,7 +16,7 @@ import os from os.path import join from textwrap import dedent -from cachetools import LRUCache +from lru import LRU import bcolz from bcolz import ctable from intervaltree import IntervalTree @@ -788,7 +788,7 @@ class BcolzMinuteBarReader(MinuteBarReader): self._minutes_per_day = metadata.minutes_per_day self._carrays = { - field: LRUCache(maxsize=sid_cache_size) + field: LRU(sid_cache_size) for field in self.FIELDS }