Commit Graph

56 Commits

Author SHA1 Message Date
Eddie Hebert e33f6dcdcd MAINT: Move equity data formats out of loader.
Put the logic for reading and writing the equity price and adjustment
data into a module located in data, making it distinct from the pipeline
loader usage of the formats.

This prepares for both incoming changes of how adjustments are written,
(which includes using the bcolz daily reader as an input), as well as
eventually providing the readers to a DataPortal object.
2015-10-09 17:20:19 -04:00
Scott Sanderson f82a01841b MAINT: Rename ALL the things.
zipline.modelling.* -> zipline.pipeline.*
zipline.data.ffc.loaders -> zipline.pipeline.loaders
tests/modelling -> tests/pipeline
2015-10-01 18:03:53 -04:00
Scott Sanderson 26fd6fda8b ENH/BUG: Modeling API enhancements.
- Fixes an error where Modeling API data known as of the close of `day
  N` would be shown to algorithms during `before_trading_start` as of
  the close of the same day.  Algorithms should now only receive data
  during `before_trading_start/handle_data` that was known as of the
  simulation time at which the function would be called.

- All Term instances now have a `mask` attribute that must be a `Filter`
  or an instance of `AssetExists()`.  `mask` can be used to specify that
  a Factor should be computed in a manner that ignores the values that
  were not `True` in the mask.

- Changed the interface for `FFCLoader.load_adjusted_array` and
  `Term._compute` from `(columns, mask)`, with mask as a DataFrame, to
  `(columns, dates, assets, mask)`, where mask is a numpy array.  This
  is primarily to avoid having to reconstruct extra DataFrames when
  using masks produced by non `AssetExists` filters.

- Adds `BoundColumn.latest`, which gives the most-recently-known value
  of a column.
2015-09-16 01:47:11 -04:00
Scott Sanderson 6e8a4b8144 ENH: Improvements to rank().
- Add an `ascending=True` keyword to `rank()`.

- Add `top(N)` and `bottom(N)` methods to Factor.  These return Filters
  that pass the top and bottom N elements each day.

- Add a slightly faster path for rank(method='ordinal').  I had
  originally thought the fast path was 2-3x faster because I had my
  benchmark data axes flipped.  The actual speedup is only 5-10%, which
  means it probably wasn't worth the effort to Cythonize...but we have a
  slightly faster version now so we might as well use it.

- Refactor test_filter and test_factor to make it easier to implement
  and test transformations on factors.  These tests now subclass
  BaseFFCTestCase, which provides facilities for passing a dict of terms
  and an "initial_workspace", the values for which are used by
  SimpleFFCEngine rather than needing to manually manage the inputs and
  outputs of each term.
2015-08-31 00:32:33 -04:00
Jonathan Kamens ee47ec1d3d BLD: Package all zipline.* modules when building eggs.
Rather than specifying only the package "zipline" in setup.py, use
`find_packages` to find all the subpackages as well, so they (or, most
specifically, their `__init__.py` files) are properly packaged in the
egg file.
2015-08-19 10:38:11 -04:00
Jonathan Kamens f2d5f42a6b BLD: Lazy-load Cython and numpy when installing package.
Modify setup.py to defer the use of Cython and numpy until
`setup_requires` has already been processed, so that Cython and numpy
are available when they are needed.
2015-08-19 10:37:25 -04:00
Scott Sanderson a801547122 BLD: Read requirements from setup.py
- Parse our requirements.txt to keep install_requires up to date.
- Create extras builds for talib and dev.
- Use pip install -e .[dev] on Travis to install Zipline before testing.
2015-08-19 03:31:29 -04:00
Scott Sanderson e91b1c56b2 MAINT: Remove unused import. 2015-08-04 01:40:16 -04:00
Scott Sanderson ef4f642e62 ENH: Compute engine architecture for FFC API.
This patch lays the groundwork for a compute engine designed to
facilitate construction of factor-based universe screening and portfolio
allocation.  It contains:

A new module, `zipline.modelling`, containing entities that can be used
to express computations as dependency graphs.  Each node in such a graph
is an instance of the base `Term` class, defined in
`zipline.modelling.term`.  Dependency graphs are executed by instances
of `FFCEngine`, defined in `zipline.modelling.engine`.

A new module, `zipline.data.ffc`, containing loaders and dataset
definitions for inputs to the modelling API.

New `TradingAlgorithm` api methods: `add_factor`, and `add_filter`.
These methods can only be called from `initialize`, and are used to
inform the algorithm that each day it should compute the given terms.
Computed factor results are made available through a new attribute of
the `data` object in `before_trading_start` and `handle_data`.  Computed
filter results control which assets are available in the factor matrix
on each day.
2015-07-29 12:30:46 -04:00
Scott Sanderson 6b72b60cde MAINT: Don't install non-zipline packages.
In particular, don't give anyone who installs zipline a global package
named 'tests'.  (sob)
2015-07-29 12:30:46 -04:00
Jonathan Kamens 3a62db8ca8 BLD: Don't hard-code a Cython version in setup.py 2015-03-19 17:21:25 -04:00
jfkirk 2fd2f02c2a MAINT: Refactors Security to Asset
This commit refactors the Security cython class to Asset, and refactors some fields of the class accordingly. This change is so the terminology is consistent and correct when Asset is extended to asset types that are not securities, such as futures.
2015-03-19 13:23:40 -04:00
jfkirk 0375b350b8 ENH: Adds Security cython class in new package 'zipline.assets'
The class is not yet used. Adding this class is part of the effort to allow Zipline
simulation of more types of assets than stocks.

DEV: Adds build_ext to .travis.yml
2015-03-04 14:19:29 -05:00
Thomas Wiecki 556c5a8207 BLD Fix setup.py and add link to homepage. 2015-02-17 13:50:33 +01:00
Thomas Wiecki 21c23c324d Bump version: 0.8.0 → 0.8.0rc1 2015-02-13 17:53:02 +01:00
Thomas Wiecki 1a51ff1ee9 BLD Remove setup.py rst conversion. Add README.md as pypi description. 2015-02-13 13:36:42 +01:00
fawce 2f7983fa35 adding data files to the egg for pip distribution. 2015-02-05 13:57:40 -05:00
Thomas Wiecki 3f1c3b39ad MAINT: Make talib an optional dependency. Fixes #362. 2014-08-04 13:25:46 +02:00
Thomas Wiecki a7de02176b Bump version: 0.7.0rc1 → 0.7.0 2014-07-25 19:34:49 +02:00
Thomas Wiecki 8d16efc5c4 Bump version: 0.7.0 → 0.7.0rc1 2014-07-18 15:38:30 +02:00
Thomas Wiecki d6f26274ac Bump version: 0.6.1 → 0.7.0 2014-07-18 15:38:20 +02:00
twiecki f9fded97ac ENH: Implement CLI.
Add a CLI that reads in an algorithm, loads data,
run the algorithm, and output performance metrics.

The examples are adapted to the new zipline API and
analyses are split into separate files.

Also add config files that run the example
algorithms with preset settings.
2014-05-07 15:34:36 -04:00
twiecki b38bf07a95 Bump version: 0.6.0 → 0.6.1 2014-04-17 15:49:33 -04:00
twiecki b0220ab225 BLD: Add six as dependency. 2014-04-14 08:03:48 -04:00
Eddie Hebert 61ccce760e BLD: Remove unused requirement of iso8601 package. 2014-01-08 11:13:26 -05:00
Eddie Hebert 063039ea07 REL: Add Python 3 to PyPI classifiers. 2014-01-08 11:06:39 -05:00
Eddie Hebert 4c6b9b945d REL: Release v0.6.0
Highlights

- Reworked risk metrics, including verification against Excel spreadsheet
- Additional order methods
- Conversion of many data structures to use pandas
- Change to behavior of stop and limit orders (@pcawthron)
- Use pandas timezone handling throughout instead of Delorean
- New commission model (@stanh)
- Adds beginning of support for Toronto stock exchange. (@dstephens)
- Python 3 compatibility.
  Unit tests now pass when run with Python 3.3, and Python 3 should
  now be considered officially supported.
  If anything does not work under Python 3, please file as a bug.
2014-01-08 10:00:31 -05:00
Eddie Hebert bbad5b386a MAINT: Removed unused test_utils.check functions.
The test_utils were the only references to the blist package,
removing so that blist can be removed as a dependency.
2013-12-02 13:19:00 -05:00
Eddie Hebert 408c129760 BLD: Remove Delorean as a build and setup dependency.
Now that we use pandas Timestamp throughout, Delorean is no longer
needed as a dependency.
2013-11-11 11:47:41 -05:00
Eddie Hebert b44fc20e4e MAINT: Remove msgpack as a dependency.
Now that the data serialization uses pandas, msgpack is no longer
needed.
2013-10-01 14:28:11 -04:00
Thomas Wiecki 2026937dc9 BLD: Add version to zipline, bump to 0.5.11.dev
zipline.__version__ is now present. Closes #94.

Moreover, git master should have a .dev version string according
to convention. Releases then get the .dev label removed.
2013-08-08 11:12:10 -04:00
Thomas Wiecki d054008990 BLD: Bumped version to 0.5.10. 2013-07-27 09:50:37 -04:00
Eddie Hebert 45bca4301f REL: v0.5.9
Highlights:

- Benchmark updating now permits empty ranges.
  (Fixes runtime crash when running immediately after Easter 2013.)
- Risk metrics
  - Performance improvents from converting to numpy and pandas.
    <@wesm, wesmckinn@gmail.com>
  - Refactoring of risk metric calculation out of class structure.
2013-04-02 11:22:31 -04:00
Eddie Hebert 7dfa0d1980 REL: v0.5.8
- Fixes bug/confusion caused by pandoc conversion in setup.py
- Slight refactorings, removing missing methods, etc.
2013-03-27 13:04:24 -04:00
Eddie Hebert 09af6fb721 BUG: Avoids install errors caused by lack of pandoc binary.
The pyandoc module throws an OSError of:
"No such file or directory",
when the underlying pandoc binary does not exist.

This error has caused confusion for numerous people during pip
installation.

pandoc is only needed on upload to PyPI to convert to ReST.
So, instead of doing a try/except on the `import pandoc` for all cases,
now checking whether or not 'upload' was invoked when calling setup.py,
so that only maintainers have to worry about installation of pandoc.

By only exercising the pandoc logic when
2013-03-27 12:27:17 -04:00
Eddie Hebert 19a1279385 REL: v0.5.7
Highlights, with thanks to contributors inline:

- Runtime performance improvements
- Fixed the omission of peformance messages on days with no trades
- Changes to batch_transform implementation
-- supports sid filtering
-- performance improvements using pandas
-- added an option for only computating when there is a window length's
   worth of data
- Added new risk metrics
-- Sortino
-- information ration
  (Ryan Day, ryanday2@gmail.com @rday)
- Added stop and limit orders
  (Tony Worm, verdverm@gmail.com @verdverm)
- Added variable recording
- Deprecated market_aware and delta kwargs to EventWindow
- Fixes to trading calendars for missing holidays
- Added TradingEnviorment context manager
- Added support for streaming through dividends
- Yahoo source now has OHLC
- Updates downloaded benchmark and treasury data when new data is available.
  (Ryan Day, ryanday2@gmail.com @rday)
- Added optional adjustment of Yahoo data
  (Jeremiah Lowin, jlowin@lowindata.com @jlowin)
2013-03-25 12:44:45 -04:00
Aidan 724fe60f20 adding delorean to dependency list 2013-02-24 18:10:19 +11:00
Eddie Hebert c919e380f4 Handles the case where pandoc isn't available during download.
Also bumps version up to 0.5.6 so the new version will apply.
2012-12-19 16:25:58 -05:00
Eddie Hebert 1af76458fd Release 0.5.5
Salient changes since last version:

- Adds non-holiday closings to trading calendar.
- Forward filling of missing treasury data.
- Improves handling of treasury data when the backtest's
  end date day is not a market day.
- Adds option to forward fill data in batch transform.
2012-12-18 10:49:32 -05:00
Eddie Hebert 1f09450584 Fixes reading of README file. 2012-12-03 19:43:41 -05:00
Eddie Hebert 11a31dff22 Updates release version to 0.5.4
Bugfix release.

Notable fixes:
- algorithm crashes due to missing data panel slots
- slippage model getting out of sync with the algorithm.
2012-12-03 18:26:48 -05:00
Eddie Hebert 4d0303cc75 Converts README.md file to ReST for setup's long_description.
So that we can have one README.md in source control, but have
a README that is compatible with PyPI.

Adds pyandoc on which the doc conversion depends.
2012-11-26 14:48:03 -05:00
Eddie Hebert e7dfca723d Relase 0.5.3
Main fix contained with in is the fix to the time step in risk
metric benchmarks.
2012-11-20 16:10:08 -05:00
Eddie Hebert 7ff1ab2ab1 Makes indentation of setup.py compatible with flake8 2012-11-20 16:10:08 -05:00
Eddie Hebert e5f41e7455 Bumps release to 0.5.2.
Mainly fixes to imports and downloading of resources that were
preventing installations.
2012-11-12 12:47:48 -05:00
Eddie Hebert 742b44f87b Adds requests library to setup's required libraries.
So that loading of external data works 'out of the box'.
2012-11-08 22:49:15 -05:00
Eddie Hebert c0b260fc4a Bumps version up to 0.5.1 in setup config. 2012-10-25 22:31:15 -04:00
Eddie Hebert c1227105ab Tweaks indentation. 2012-10-25 22:30:46 -04:00
Eddie Hebert c26a6442e5 Moves project back over to using setuptools.
distutils was throwing errors about install_requires nor was
it successfully uploading to PyPI.

We'll look at distutils2 when it's pulled into core.
2012-10-15 21:21:38 -04:00
Eddie Hebert 4955ceea44 Adds submodules to setup.py 2012-10-12 16:10:39 -04:00