Skip to content

Commit

Permalink
Merge 9fd8ec1 into 8756bf2
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Sanderson committed May 5, 2016
2 parents 8756bf2 + 9fd8ec1 commit 66e3f9b
Show file tree
Hide file tree
Showing 38 changed files with 2,785 additions and 301 deletions.
47 changes: 46 additions & 1 deletion docs/source/whatsnew/1.0.0.txt
Expand Up @@ -58,6 +58,27 @@ argument to ``$ python -m zipline run`` or as the ``bundle`` argument to

For more information see `Data Bundles`_ for more information.

String Support in Pipeline (:issue:`1174`)
``````````````````````````````````````````

Added support for string data in Pipeline.
:class:`zipline.pipeline.data.Column` now accepts ``object`` as a dtype, which
signifies that loaders for that column should emit windowed iterators over the
experimental new :class:`~zipline.lib.labelarray.LabelArray` class.

Several new :class:`~zipline.pipeline.Classifier` methods have also been added
for constructing :class:`~zipline.pipeline.Filter` instances based on string
operations. The new methods are:

- :meth:`~zipline.pipeline.Classifier.element_of`
- :meth:`~zipline.pipeline.Classifier.startswith`
- :meth:`~zipline.pipeline.Classifier.endswith`
- :meth:`~zipline.pipeline.Classifier.has_substring`
- :meth:`~zipline.pipeline.Classifier.matches`

``element_of`` is defined for all classifiers. The remaining methods are
only defined for string-dtype classifiers.

Enhancements
~~~~~~~~~~~~

Expand Down Expand Up @@ -87,14 +108,38 @@ Enhancements
Custom factors are now capable of computing and returning multiple outputs,
each of which are themselves a Factor. (:issue:`1119`)

* Added support for string-dtype pipeline columns. Loaders for thse columns
should produce instances of :class:`zipline.lib.labelarray.LabelArray` when
traversed. :meth:`~zipline.pipeline.data.BoundColumn.latest` on string
columns produces a string-dtype
:class:`zipline.pipeline.Classifier`. (:issue:`1174`)

* Added several methods for converting Classifiers into Filters.

The new methods are:
- :meth:`~zipline.pipeline.Classifier.element_of`
- :meth:`~zipline.pipeline.Classifier.startswith`
- :meth:`~zipline.pipeline.Classifier.endswith`
- :meth:`~zipline.pipeline.Classifier.has_substring`
- :meth:`~zipline.pipeline.Classifier.matches`

``element_of`` is defined for all classifiers. The remaining methods are
only defined for strings. (:issue:`1174`)


Experimental Features
~~~~~~~~~~~~~~~~~~~~~

.. warning::

Experimental features are subject to change.

None
* Added a new :class:`zipline.lib.labelarray.LabelArray` class for efficiently
representing and computing on string data with numpy. This class is
conceptually similar to :class:`pandas.Categorical`, in that it represents
string arrays as arrays of indices into a (smaller) array of unique string
values. (:issue:`1174`)


Bug Fixes
~~~~~~~~~
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Expand Up @@ -81,11 +81,13 @@ def build_extensions(self):
ext_modules = [
Extension('zipline.assets._assets', ['zipline/assets/_assets.pyx']),
Extension('zipline.lib.adjustment', ['zipline/lib/adjustment.pyx']),
Extension('zipline.lib._factorize', ['zipline/lib/_factorize.pyx']),
Extension(
'zipline.lib._float64window', ['zipline/lib/_float64window.pyx']
),
Extension('zipline.lib._int64window', ['zipline/lib/_int64window.pyx']),
Extension('zipline.lib._uint8window', ['zipline/lib/_uint8window.pyx']),
Extension('zipline.lib._labelwindow', ['zipline/lib/_labelwindow.pyx']),
Extension('zipline.lib.rank', ['zipline/lib/rank.pyx']),
Extension('zipline.data._equities', ['zipline/data/_equities.pyx']),
Extension('zipline.data._adjustments', ['zipline/data/_adjustments.pyx']),
Expand Down

0 comments on commit 66e3f9b

Please sign in to comment.