DOC: Many docs improvements.

- Generate links to sourcecode via the Sphinx `viewcode` extension.
- Generate reference docs for Asset/Equity/Future, AssetFinder, and
  AssetDBWriter.
- Generate reference docs for Pipeline API classes.
- Fix broken links and formatting issues in the 0.8.4 whatsnew.
- Use embedsignature in _assets.pyx so that the signatures of Asset
  subclasses are inspectable.
This commit is contained in:
Scott Sanderson
2015-11-19 00:15:17 -05:00
parent dfe21dc1de
commit 1524944edd
6 changed files with 88 additions and 11 deletions
+58 -4
View File
@@ -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:
+1
View File
@@ -15,6 +15,7 @@ extensions = [
'sphinx.ext.doctest',
'sphinx.ext.extlinks',
'sphinx.ext.autosummary',
'sphinx.ext.viewcode',
]
+10 -5
View File
@@ -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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+1
View File
@@ -1,3 +1,4 @@
# cython: embedsignature=True
#
# Copyright 2015 Quantopian, Inc.
#
+17 -1
View File
@@ -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 = "<AssetFinder>"
def __init__(self, engine):
+1 -1
View File
@@ -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