Skip to content

Commit 24f3080

Browse files
author
Scott Sanderson
committed
REL: 1.0.1.
Update docs, whatsnew, and stub files for the release.
1 parent 05ac438 commit 24f3080

File tree

4 files changed

+65
-48
lines changed

4 files changed

+65
-48
lines changed

docs/source/appendix.rst

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,25 @@ bugs that could cause undesirable behavior when trading with real money.
117117
Simulation Parameters
118118
`````````````````````
119119

120+
.. autofunction:: zipline.api.set_benchmark
121+
122+
Commission Models
123+
'''''''''''''''''
124+
120125
.. autofunction:: zipline.api.set_commission
121126

127+
.. autoclass:: zipline.finance.commission.CommissionModel
128+
:members:
129+
122130
.. autoclass:: zipline.finance.commission.PerShare
123131

124132
.. autoclass:: zipline.finance.commission.PerTrade
125133

126134
.. autoclass:: zipline.finance.commission.PerDollar
127135

136+
Slippage Models
137+
'''''''''''''''
138+
128139
.. autofunction:: zipline.api.set_slippage
129140

130141
.. autoclass:: zipline.finance.slippage.SlippageModel
@@ -134,8 +145,6 @@ Simulation Parameters
134145

135146
.. autoclass:: zipline.finance.slippage.VolumeShareSlippage
136147

137-
.. autofunction:: zipline.api.set_benchmark
138-
139148
Pipeline
140149
````````
141150

docs/source/whatsnew/1.0.1.txt

Lines changed: 32 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,54 @@
1-
Development
2-
-----------
1+
Release 1.0.1
2+
-------------
33

44
:Release: 1.0.1
5-
:Date: TBD
5+
:Date: May 27, 2016
66

7-
.. warning::
8-
This release is still under active development. All changes listed are
9-
subject to change at any time.
10-
11-
12-
Highlights
13-
~~~~~~~~~~
14-
15-
None
7+
This is a minor bug-fix release from 1.0.0 and includes a small number of bug
8+
fixes and documentation improvements.
169

1710
Enhancements
1811
~~~~~~~~~~~~
1912

20-
None
21-
22-
Experimental Features
23-
~~~~~~~~~~~~~~~~~~~~~
24-
25-
.. warning::
13+
- Added support for user-defined commission models. See the
14+
:class:`zipline.finance.commission.CommissionModel` class for more details on
15+
implementing a commision model. (:issue:`1213`)
2616

27-
Experimental features are subject to change.
28-
29-
None
17+
- Added support for non-float columns to Blaze-backed Pipeline
18+
datasets (:issue:`1201`).
3019

3120
Bug Fixes
3221
~~~~~~~~~
3322

34-
None
23+
- Fixed a bug where Pipeline loaders were not properly initialized by
24+
:func:`zipline.run_algorithm`. This also affected invocations of ``zipline
25+
run`` from the CLI.
3526

36-
Performance
37-
~~~~~~~~~~~
27+
- Fixed a bug that caused the ``%%zipline`` IPython cell magic to fail
28+
(:commit:`533233fae43c7ff74abfb0044f046978817cb4e4`).
3829

39-
None
30+
- Fixed a bug in the :class:`~zipline.finance.commission.PerTrade` commission
31+
model where commissions were incorrectly applied to each partial-fill of an
32+
order rather than on the order itself, resulting in algorithms being charged
33+
too much in commissions when placing large orders.
4034

41-
Maintenance and Refactorings
42-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35+
:class:`~zipline.finance.commission.PerTrade` now correctly applies
36+
commissions on a per-order basis (:issue:`1213`).
4337

44-
None
38+
- Attribute accesses on :class:`CustomFactors <zipline.pipeline.CustomFactor>`
39+
defining multiple outputs will now correctly return an output slice when the
40+
output is also the name of a :class:`~zipline.pipeline.factors.Factor` method
41+
(:issue:`1214`).
4542

46-
Build
47-
~~~~~
43+
- Replaced deprecated usage of ``pandas.io.data`` with ``pandas_datareader``
44+
(:issue:`1218`).
4845

49-
None
46+
- Fixed an issue where ``.pyi`` stub files for :mod:`zipline.api` were
47+
accidentally excluded from the PyPI source distribution. Conda users should
48+
be unaffected (:issue:`1230`).
5049

5150
Documentation
5251
~~~~~~~~~~~~~
5352

54-
None
55-
56-
Miscellaneous
57-
~~~~~~~~~~~~~
58-
59-
None
53+
- Added a new example, :mod:`zipline.examples.momentum_pipeline`, which
54+
exercises the Pipeline API (:issue:`1230`).

zipline/api.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,11 +557,11 @@ def set_cancel_policy(cancel_policy):
557557
"""
558558

559559
def set_commission(commission):
560-
"""Sets the commision model for the simulation.
560+
"""Sets the commission model for the simulation.
561561
562562
Parameters
563563
----------
564-
commission : PerShare, PerTrade, or PerDollar
564+
commission : CommissionModel
565565
The commission model to use.
566566
567567
See Also

zipline/finance/commission.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,38 @@
2424
class CommissionModel(with_metaclass(abc.ABCMeta)):
2525
"""
2626
Abstract commission model interface.
27+
28+
Commission models are responsible for accepting order/transaction pairs and
29+
calculating how much commission should be charged to an algorithm's account
30+
on each transaction.
2731
"""
2832

2933
@abstractmethod
3034
def calculate(self, order, transaction):
3135
"""
36+
Calculate the amount of commission to charge on ``order`` as a result
37+
of ``transaction``.
38+
3239
Parameters
3340
----------
34-
order: the order whose transaction we are processing. Its `commission`
35-
field is up to date with how much commission has been attributed
36-
to this order so far.
41+
order : zipline.finance.order.Order
42+
The order being processed.
43+
44+
The ``commission`` field of ``order`` is a float indicating the
45+
amount of commission already charged on this order.
3746
38-
transaction: the transaction we are processing.
47+
transaction : zipline.finance.transaction.Transaction
48+
The transaction being processed. A single order may generate
49+
multiple transactions if there isn't enough volume in a given bar
50+
to fill the full amount requested in the order.
3951
4052
Returns
4153
-------
42-
float: The additional commission, in dollars, that we should attribute
43-
to this order.
54+
amount_charged : float
55+
The additional commission, in dollars, that we should attribute to
56+
this order.
4457
"""
45-
pass
58+
raise NotImplementedError('calculate')
4659

4760

4861
class PerShare(CommissionModel):

0 commit comments

Comments
 (0)