This patch lays the groundwork for a compute engine designed to
facilitate construction of factor-based universe screening and portfolio
allocation. It contains:
A new module, `zipline.modelling`, containing entities that can be used
to express computations as dependency graphs. Each node in such a graph
is an instance of the base `Term` class, defined in
`zipline.modelling.term`. Dependency graphs are executed by instances
of `FFCEngine`, defined in `zipline.modelling.engine`.
A new module, `zipline.data.ffc`, containing loaders and dataset
definitions for inputs to the modelling API.
New `TradingAlgorithm` api methods: `add_factor`, and `add_filter`.
These methods can only be called from `initialize`, and are used to
inform the algorithm that each day it should compute the given terms.
Computed factor results are made available through a new attribute of
the `data` object in `before_trading_start` and `handle_data`. Computed
filter results control which assets are available in the factor matrix
on each day.
Move the responsibility of wrapping the main simulation loop in the
ZiplineAPI context from the algorithm modules generator setup to the
main trade simulation loop, so that different methods of invoking loop
do not need to duplicate how the context is set.
To make it easier for internal implementation of handle_data to
transition off of calling the ZiplineAPI every bar, to only invoking the
context once per simulation.
In d01e718373, we made a change for
compatibility with a change introduced in pip 7.0.0. Then the pip
maintainers went and reverted the change in pip 7.0.2, thereby
breaking our requirements file for the second time in ten days. This
change reverts the prior change so that we are once again compatible
with the current version of pip.
Also, to make it easier for people to avoid pip compatibility issues,
we're now specifying pip>=7.0.3 in etc/requirements.txt.
based OrderedDict. Series/ndarray can only be sped up so much because
they weren't designed for fast iterative mutations.
This also cut down on the # of intermediate Series being generated
during perf stat generation. Things like s[s > 0] will create a new
Series for s > 0.
Moved cython to requirements.txt and added cyordereddict
The internal system used to build and get burn-in on packages was
accidentally using scipy 0.12.0, despite the change in the requirements
file to 0.13.2
Setting back to using scipy 0.12.0 until 0.13.2 is more tested with
internal systems, with the goal of upgrading to >= 0.14.0 as soon as
possible.
Since TA-Lib's releases are hosted on Github instead of PyPI,
add the `allow-external` and `allow-unverified` flags for just
TA-Lib.
This change means that versions of pip < 1.5 can not be used,
since the flags do not exist in those versions.
Upgrade requests from 2.2.0 to 2.3.0
To keep up-to-date, Changelog does not appear to have any changes
that would affect our usage one way or the other.
Since statsmodels requires patsy, and statsmodels is now in
requirements.txt instead of requirements_dev.txt, patsy also needs to
be in requirements.txt instead of requirements_dev.txt.
Pandas website states statsmodels is needed for parts of pandas.stats.
Also, update statsmodels to 0.5.0.
Upgrade of version is to both keep up to date, and to improve
performance on lazy imports, as fixed by
https://github.com/statsmodels/statsmodels/issues/573