mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-27 18:42:13 +08:00
ENH: Switching from cachetools.LRUCache to lru-dict's LRU cache.
lru-dict is written in C and seems much more performant.
This commit is contained in:
@@ -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.
|
||||
@@ -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.
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user