-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from tejtw/v2.0.0rc3
MAINT:loaders
- Loading branch information
Showing
12 changed files
with
3,270 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from .equity_pricing_loader import ( | ||
EquityPricingLoader, | ||
USEquityPricingLoader, | ||
) | ||
from .fundamentals import TQuantFundamentalsPipelineLoader, TQuantAlternativesPipelineLoader | ||
|
||
|
||
import os | ||
module_dir = os.path.dirname(os.path.abspath(__file__)) | ||
ls_files = os.listdir(module_dir) | ||
ndb_exist = [f for f in ls_files if f.startswith('ndb')] | ||
if ndb_exist: | ||
from .ndb_stk import NDBStkPipelineLoader | ||
from .ndb_fin import NDBFinPipelineLoader | ||
|
||
|
||
|
||
__all__ = [ | ||
"EquityPricingLoader", | ||
"USEquityPricingLoader", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
""" | ||
Base class for Pipeline API data loaders. | ||
""" | ||
from interface import default, Interface | ||
|
||
|
||
class PipelineLoader(Interface): | ||
"""Interface for PipelineLoaders.""" | ||
|
||
def load_adjusted_array(self, domain, columns, dates, sids, mask): | ||
""" | ||
Load data for ``columns`` as AdjustedArrays. | ||
Parameters | ||
---------- | ||
domain : zipline.pipeline.domain.Domain | ||
The domain of the pipeline for which the requested data must be | ||
loaded. | ||
columns : list[zipline.pipeline.data.dataset.BoundColumn] | ||
Columns for which data is being requested. | ||
dates : pd.DatetimeIndex | ||
Dates for which data is being requested. | ||
sids : pd.Index | ||
Asset identifiers for which data is being requested. | ||
mask : np.array[ndim=2, dtype=bool] | ||
Boolean array of shape (len(dates), len(sids)) indicating dates on | ||
which we believe the requested assets were alive/tradeable. This is | ||
used for optimization by some loaders. | ||
Returns | ||
------- | ||
arrays : dict[BoundColumn -> zipline.lib.adjusted_array.AdjustedArray] | ||
Map from column to an AdjustedArray representing a point-in-time | ||
rolling view over the requested dates for the requested sids. | ||
""" | ||
|
||
@default | ||
@property | ||
def currency_aware(self): | ||
"""Whether or not this loader supports currency-conversions. | ||
By default, assume that loaders to not support currency conversions. | ||
""" | ||
return False |
Oops, something went wrong.