- 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.
Our DataFrame index resolution logic relies on failed lookups **not**
being cached, but not caching failed lookups is a nontrivial performance
hit when repeatedly looking up sids. The "solution" here is to clear
the caches after writing in new assets.
The real fix for this is either:
1. Don't construct an AssetFinder until we have the datasource in hand
in run(), or
2. Don't symbol-map the user's input source if it's a DataFrame.
Instead we should make our data loaders pre-map the data.
Previously we have capitalized input strings at different levels in
our code: in the user-facing API methods and in the asset finder.
This commit moves input string capitalization exclusively to the API
method to which the string was supplied. Specifically, the string is
capitalized by a preprocess API method decorator. The preprocess
decorator passes the input string to the newly defined
ensure_upper_case() method, which returns a TypeError if the argument
supplied is not a string.
ensure_upper_case() is defined in a new file, zipline/utils/input_validation.py.
The existing expect_types() method is also moved there.
Various tests in tests/test_assets.py are modified to account for the
fact that the asset finder method lookup_symol() no longer capitalizes
its supplied argument.
Improves the query for futures contract to use the date that comes first
in time (between notice_date and expiration_date) to determine cotnract
validity. If one of these is missing, we'll use the other.
Also modifies the query to order the resulting contracts by their
expiration_date if available, and to use their notice_date if not.