mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-05 19:39:15 +08:00
PERF: Call concatenate directly instead of hstack.
Avoids a couple function calls in a hot path.
This commit is contained in:
@@ -18,8 +18,8 @@ from abc import (
|
||||
abstractproperty,
|
||||
)
|
||||
|
||||
from numpy import concatenate
|
||||
from lru import LRU
|
||||
from numpy import hstack
|
||||
from pandas import isnull
|
||||
from pandas.tslib import normalize_date
|
||||
from toolz import sliding_window
|
||||
@@ -522,7 +522,11 @@ class HistoryLoader(with_metaclass(ABCMeta)):
|
||||
field,
|
||||
is_perspective_after)
|
||||
end_ix = self._calendar.get_loc(dts[-1])
|
||||
return hstack([window.get(end_ix) for window in block]).round(3)
|
||||
|
||||
return concatenate(
|
||||
[window.get(end_ix) for window in block],
|
||||
axis=1,
|
||||
).round(3)
|
||||
|
||||
|
||||
class DailyHistoryLoader(HistoryLoader):
|
||||
|
||||
Reference in New Issue
Block a user