diff --git a/docs/source/appendix.rst b/docs/source/appendix.rst index 73152222..473cd0fa 100644 --- a/docs/source/appendix.rst +++ b/docs/source/appendix.rst @@ -1,8 +1,62 @@ -Zipline API ------------ +API Reference +------------- -For each of these api functions, the ``self`` argument is implicitly the current -:class:`~zipline.algorithm.TradingAlgorithm` +Algorithm API +~~~~~~~~~~~~~ + +The following methods are available for use in the ``initialize``, +``handle_data`` and ``before_trading_start`` API functions. + +In all listed functions, the ``self`` argument is implicitly the +currently-executing :class:`~zipline.algorithm.TradingAlgorithm` instance. .. automodule:: zipline.api :members: + +.. autoclass:: zipline.algorithm.TradingAlgorithm + +Pipeline API +~~~~~~~~~~~~ + +.. autoclass:: zipline.pipeline.Pipeline + :members: + :member-order: groupwise + +.. autoclass:: zipline.pipeline.CustomFactor + :members: + :member-order: groupwise + +.. autoclass:: zipline.pipeline.factors.Factor + :members: top, bottom, rank, percentile_between, isnan, notnan, isfinite, + eq, __add__, __sub__, __mul__, __div__, __mod__, __pow__, __lt__, + __le__, __ne__, __ge__, __gt__ + :exclude-members: dtype + :member-order: bysource + +.. autoclass:: zipline.pipeline.filters.Filter + :members: __and__, __or__ + :exclude-members: dtype + +Asset Metadata +~~~~~~~~~~~~~~ + +.. autoclass:: zipline.assets.assets.Asset + :members: + +.. autoclass:: zipline.assets.assets.Equity + :members: + +.. autoclass:: zipline.assets.assets.Future + :members: + +.. autoclass:: zipline.assets.assets.AssetFinder + :members: + +.. autoclass:: zipline.assets.assets.AssetFinderCachedEquities + :members: + +.. autoclass:: zipline.assets.asset_writer.AssetDBWriter + :members: + +.. autoclass:: zipline.assets.assets.AssetConvertible + :members: diff --git a/docs/source/conf.py b/docs/source/conf.py index db83801b..06dae84c 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -15,6 +15,7 @@ extensions = [ 'sphinx.ext.doctest', 'sphinx.ext.extlinks', 'sphinx.ext.autosummary', + 'sphinx.ext.viewcode', ] diff --git a/docs/source/whatsnew/0.8.4.txt b/docs/source/whatsnew/0.8.4.txt index 6265a6a1..c61cce9f 100644 --- a/docs/source/whatsnew/0.8.4.txt +++ b/docs/source/whatsnew/0.8.4.txt @@ -19,7 +19,10 @@ Enhancements passed to :class:`~zipline.algorithm.TradingAlgorithm` by the keyword argument ``create_event_context`` (:issue:`828`). -* Added `isnan`, `notnan`, and `isfinite` methods to `Factor` (:issue:`861`). +.. py:currentmodule:: zipline.pipeline.factors + +* Added :meth:`~Factor.isnan`, :meth:`~Factor.notnan` and + :meth:`~Factor.isfinite` methods to :class:`Factor` (:issue:`861`). Experimental Features ~~~~~~~~~~~~~~~~~~~~~ @@ -40,10 +43,12 @@ Bug Fixes Performance ~~~~~~~~~~~ -* Speeds up `AssetFinder.lookup_symbol` by adding an extension, -`AssetFinderCachedEquities`, that loads equities into dictionaries and -then directs `lookup_symbol` to these dictionaries to find matching equities - (:issue:`830`). +.. py:currentmodule:: zipline.assets.assets + +* Speeds up :meth:`AssetFinder.lookup_symbol` by adding an extension, + :class:`AssetFinderCachedEquities`, that loads equities into dictionaries and + then directs :meth:`AssetFinder.lookup_symbol` to these dictionaries to find + matching equities (:issue:`830`). Maintenance and Refactorings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/zipline/assets/_assets.pyx b/zipline/assets/_assets.pyx index 376f0cf5..fbac1d86 100644 --- a/zipline/assets/_assets.pyx +++ b/zipline/assets/_assets.pyx @@ -1,3 +1,4 @@ +# cython: embedsignature=True # # Copyright 2015 Quantopian, Inc. # diff --git a/zipline/assets/assets.py b/zipline/assets/assets.py index 045f18f4..43d79024 100644 --- a/zipline/assets/assets.py +++ b/zipline/assets/assets.py @@ -76,9 +76,25 @@ def _convert_asset_timestamp_fields(dict_): class AssetFinder(object): + """ + An AssetFinder is an interface to a database of Asset metadata written by + an ``AssetDBWriter``. + This class provides methods for looking up assets by unique integer id or + by symbol. For historical reasons, we refer to these unique ids as 'sids'. + + Parameters + ---------- + engine : str or SQLAlchemy.engine + An engine with a connection to the asset database to use, or a string + that can be parsed by SQLAlchemy as a URI. + + See Also + -------- + :class:`zipline.assets.asset_writer.AssetDBWriter` + """ # Token used as a substitute for pickling objects that contain a - # reference to an AssetFinder + # reference to an AssetFinder. PERSISTENT_TOKEN = "" def __init__(self, engine): diff --git a/zipline/pipeline/pipeline.py b/zipline/pipeline/pipeline.py index d64166d6..dbd627aa 100644 --- a/zipline/pipeline/pipeline.py +++ b/zipline/pipeline/pipeline.py @@ -17,7 +17,7 @@ class Pipeline(object): To compute a pipeline in the context of a TradingAlgorithm, users must call ``attach_pipeline`` in their ``initialize`` function to register that the pipeline should be computed each trading day. The outputs of a pipeline on - a given day can be accessed by calling ``pipeline_outputs`` in + a given day can be accessed by calling ``pipeline_output`` in ``handle_data`` or ``before_trading_start``. Parameters