Commit graph

32 commits

Author SHA1 Message Date
samatix
1da88f8196 Merge branch 'benchmark' into benchmark2
* benchmark:
  STY: Flake8 style amendments
2020-04-20 15:20:05 +02:00
samatix
b32f55409e STY: Flake8 style amendments 2020-04-20 15:16:28 +02:00
Ayoub ENNASSIRI
7651c05dc7
Merge branch 'master' into benchmark 2020-04-20 14:30:36 +02:00
Scott Sanderson
66f144379d MAINT: Updates to fix tests. 2020-04-17 10:19:44 -04:00
Miguel Sánchez de León Peque
7fc7bc5933 TST: Fix tests for Python 3.6 compatibility
While testing examples, positions are not in the expected order.
2020-02-04 10:55:16 -05:00
peterhbromley
1abcb34a65
Merge pull request #2638 from quantopian/fix-examples-imports
MAINT: Stop always importing all zipline examples
2020-02-04 10:30:15 -05:00
peterhbromley
eee999c154 MAINT: Stop always importing all examples 2020-01-28 13:20:03 -05:00
Scott Sanderson
d943e4bcd2 MAINT: Remove treasury curves. 2020-01-21 12:39:02 -05:00
Scott Sanderson
ce2a2363f8 MAINT: Remove TradingEnvironment. 2018-07-17 09:45:05 -04:00
Joe Jevnik
1f50b1b0d3 ENH: new risk metrics API 2018-02-26 17:48:14 -05:00
Freddie Vargus
5160b11bc1 TST: Updated modified time of market data in test_examples 2017-06-07 11:00:55 -04:00
Freddie Vargus
a12c34c39c MAINT: Skip more rows to match change in treasury data format
I'm not sure what the raw csv pulled from the federal reserve looked like before, but when trying to download fresh treasure data (data not stored in `./zipline`), there is an error that says "Time Period not in list". After checking the raw csv now, it looks like there are 5 header rows rather than just 1, so skipping those rows removes that error.
2017-06-05 11:44:01 -04:00
Freddie Vargus
7a6f45b971 TST: Change start date to fit benchmark start date 2017-06-01 23:35:11 -04:00
Freddie Vargus
f957545e47 TST: Sort test examples to debug more easily 2017-06-01 23:35:11 -04:00
Freddie Vargus
776677fcdf BUG/MAINT: Switch over to Google for benchmarking
MAINT: Remove mentions of Yahoo & ^GSPC

MAINT: Fill in missing dates

MAINT/BLD: Rebuild example data to match new benchmark
2017-06-01 23:35:10 -04:00
Richard Frank
8734224701 TST: Use testing market data with run_algorithm
so env doesn't need to download it
2017-05-18 12:54:06 -04:00
Richard Frank
bcc187605c MAINT: Break reference cycle between algorithm and simulator
when simulation finishes, so that resources are cleaned up
deterministically.
2016-06-03 11:24:43 -07:00
Scott Sanderson
5e87bf2496 HACK: Call gc.collect in test_examples.
We need to call gc.collect before tearing down our class because we have
a cycle between TradingAlgorithm and AlgorithmSimulator which ultimately
holds a reference to the pipeline engine passed to the tests here.

This means that we're not guaranteed to have deleted our disk-backed
resource readers (e.g. SQLiteAdjustmentReader) before trying to delete
the tempdir, which causes failures on Windows because Windows doesn't
allow you to delete a file if someone still has an open handle to that
file.

The real fix for this is to break the cycle between TradingAlgorithm and
AlgorithmSimulator, but that requires significant breaking API changes.
2016-05-25 17:09:30 -04:00
Scott Sanderson
392ac2f9d6 DOC/TEST: Add example algo using Pipeline. 2016-05-24 22:34:05 -04:00
Joe Jevnik
89542e33bd ENH: Adds quantopian-quandl bundle as new default.
This data bundle will use the quantopian mirror of the quandl WIKI data
instead of downloading from quandl directly. This dramatically improves
the speed because we do not pay the rate limiting for quandl and we can
send the data in the format zipline expects.
2016-05-05 18:22:13 -04:00
Joe Jevnik
59c8e371a2 ENH: Updates the cli, data bundles and extensions.
Adds the data bundle concept which makes it easy for users to register
loading functions to build out minute and daily data along with an
assets db and adjustments db. By default we have provided a `quandl`
bundle which pulls from the public domain WIKI dataset. Users may
register new bundles by decorating an ingest function with
`zipline.data.bundles.register(<name>)`. This also provides a
`yahoo_equities` function for creating an ingestion function that will
load a static set of assets from yahoo.

The cli is now structured as a couple of subcommands and has been
changed to `python -m zipline`. The old behavior of `run_algo.py` has
been moved to the `run` subcommand. This is almost entirely the same
except that it now takes the name of the data bundle to use, defaulting
to `quandl`.

The next subcommand is `ingest` which takes the name of
a data bundle to ingest. This will run the loading machinery and write
the data to a specified location that `run` can find.

There is also a `clean` subcommand which deletes the data that was
written with `ingest`.

Extensions have also been added to zipline. This is an experimental
feature where users can provide an extra set of python files to run at
the start of the process. These can be used to configure aspects of
zipline. Right now the only thing that is supported in an extension file
is the registration of a new data bundle.
2016-05-03 18:38:24 -04:00
Eddie Hebert
16fd6681a6 ENH: Rewrite of Zipline to use lazy access pattern
More documentation to follow in release notes.

Based on lazy-mainline branch, see for more details.

Also-By: Jean Bredeche <jean@quantopian.com>
Also-By: Andrew Liang <aliang@quantopian.com>
Also-By: Abhijeet Kalyan <akalyan@quantopian.com>
2016-04-04 16:12:58 -04:00
Scott Sanderson
5f49fa22cb MAINT: Upgrade numpy and fix warnings.
Mostly fixes ambiguous calls to numpy.full, and uses explicitly-united
NaT values.
2016-02-11 18:46:39 -05:00
jfkirk
dc964a7e7d MAINT: Removes the ability to reference a global TradingEnvironment
This commit removes the ability to reference a shared TradingEnvironment through the zipline.finance.trading module. In place, the classes that require a TradingEnvironment, or its child AssetFinder, contain their own references to those objects.

This commit also adds serialization utilities that allow for the pickling/unpickling of objects without unintentionally their TradingEnvironments or AssetFinders.
2015-09-10 11:53:28 -04:00
Stewart Douglas
1ef2274d11 MAINT: Update tests to conform to new reader/writer structure 2015-09-10 11:53:26 -04:00
Stewart Douglas
45adc57267 TST: Simulate running an algo using scripts/run_algo.py
Previously we have not had test coverage of the parse_args() or
run_pipeline() functions invoked when running scripts/run_algo.py.
2015-09-10 11:47:45 -04:00
Stewart Douglas
283c959cc4 MAINT: Move analyze methods into algorithm files 2015-09-10 11:36:14 -04:00
Jonathan Kamens
2521263c06 TST: Prevent some test cases from being split 2015-08-25 11:56:36 -04:00
Jonathan Kamens
dcb8aa06af TST: Simplify test_examples and convert to unittest TestCase
Also, remove use of os.chdir() in the test, which causes other tests
to break by changing the current directory in the middle of the test
run.
2015-04-30 14:24:30 -04:00
Jonathan Kamens
e942275108 STY: Flake8
Upgrade the version of the flake8, pep8, and mccabe PyPI packages, and
make the code changes necessary for compatibility with the updated
packages.
2015-03-19 17:21:25 -04:00
Eddie Hebert
d06f35623a MAINT: Make walk usage in example tests compatible with Python 3
The rename of walk is not provided by six, so check the import error
via an exception.

Also, callback behavior slightly changes between the two versions,
so instead iterate over the walked files and call what was formerly
a callback, directly as a function.
2014-01-07 11:57:45 -05:00
Thomas Wiecki
b8b21b347f TST: Added unittest that runs all examples. 2013-05-02 16:33:08 -04:00