Commit Graph

2539 Commits

Author SHA1 Message Date
Eddie Hebert 16a615f3f0 MAINT: Use setitem syntax instead of update for tracker dict addition.
Since only value is being changed, use the setitem brackets intsead of
calling updated.
2015-05-04 14:02:47 -04:00
Eddie Hebert 63dbea5da4 ENH: Remove unused minute risk containers.
The risk containers that are actually used for reports use the
'cumulative' style container which has an index of days, not minutes.

The minute containers and copying of data etc. were causing an expanding
memory footprint.
2015-05-04 13:56:29 -04:00
Eddie Hebert da0a5bbc3f MAINT: Remove dependence on intraday risk for benchmark returns.
The intraday_risk_metrics is being removed since the values are not
used; cumulative risk metrics with the last value updated to the latest
close has been used for some time.

Before the removal of intraday_risk_metrics, the position trackers
passing of benchmark returns to the cumulative risk metrics needs to no
longer depend on the calculations done by the intraday stats. So instead
use the all_benchmark_returns stored in the tracker directly.
2015-05-04 13:56:29 -04:00
Eddie Hebert 4908d5577e MAINT: Remove unsued perf_key property on simulation object.
The perf_key property is no longer referenced.
2015-05-04 13:11:31 -04:00
Jonathan Kamens 84eb25faab Merge pull request #577 from quantopian/minor_zipline_path_fix
BUG: Correct method for finding security lists directory
2015-05-04 11:30:43 -04:00
Eddie Hebert c43d504212 MAINT: Remove unused hash_args from simulation object.
The `get_hash` method on the AlgorithmSimulator is never called, so
remove.
2015-05-04 11:03:01 -04:00
Jonathan Kamens cd98b52454 BUG: Correct method for finding security lists directory
The correct thing to look at to figure out where the root of the
zipline tree is, is `zipline.__file__`, not `zipline.__path__`. The
latter could contain multiple directories in it, and is not intended
to be `os.path.join()`ed as the previous code was doing.
2015-05-04 10:42:40 -04:00
Jonathan Kamens fd0530d889 MAINT: Flake8 2015-05-01 11:03:01 -04:00
Jonathan Kamens 557e6a3009 Every setup_logger needs a teardown_logger 2015-05-01 07:38:42 -04:00
Jonathan Kamens 656bd86c17 TST: One more overwrite_sim_params=False needed 2015-04-30 15:38:09 -04:00
Jonathan Kamens c94880af2c TST: Suppress warnings in test_history_add_field_* tests
Temporarily suppress warnings for one line of the
test_history_add_field_* tests to work around #576 until it's fixed.
2015-04-30 15:31:21 -04:00
Jonathan Kamens 5c546b4f6c TST: overwrite_sim_params=False in tests when using list of sources
When specifying a list of sources to algorithm.py:run in a unit test,
specify overwrite_sim_params=False to suppress the unnessary
UserWarning.
2015-04-30 15:30:19 -04:00
Jonathan Kamens 8f9f65bdc6 MAINT: Flake8 2015-04-30 14:31:01 -04:00
Jonathan Kamens 73459333ef TST: Fix DeprecationWarning in xlrd by using custom version of it 2015-04-30 14:24:47 -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 7bb2677a9d TST: Convert test_munge.py tests to unittest format 2015-04-30 13:27:46 -04:00
Jonathan Kamens 865a20099a MAINT: Use "difference" instead of "-" to make Pandas happy 2015-04-30 13:19:00 -04:00
Jonathan Kamens d1b1708ccb Merge pull request #574 from quantopian/do_not_modify_security_lists_directory
TST: Don't modify master security lists directory during tests
2015-04-30 13:01:09 -04:00
Jonathan Kamens ca0f906b11 TST: Don't modify master security lists directory during tests
Rather than drop files temporarily into the master security lists
directory during unit tests, create temporary directories for the
tests. This avoids issues when the tests are being run at the same
time as other code that uses the real security lists data.
2015-04-29 21:41:32 -04:00
Eddie Hebert 00ea7b04d1 PERF: Reduce memory usage during risk metric calculations.
For beta calculation:

Remove `.dropna` , since it was creating a new
Series and Index which inflated memory usage as algorithm run time
progressed.

For downside risk calculations:

Instead of using pd.Series calculations, pass the underlying
numpy array which have already been sliced to the exact dt, so that the
call to `round` does not create a new Series.
2015-04-28 13:22:04 -04:00
Jonathan Kamens e5a93b6f7e MAINT: Upgrade requests to 2.6.2 2015-04-24 07:12:07 -04:00
Eddie Hebert a4f85b9436 Merge pull request #570 from quantopian/orders-by-modified-leak
Remove leaky defaultdicts
2015-04-23 15:43:03 -04:00
Jonathan Kamens 5ea4886dc1 MAINT: Upgrade requests to 2.6.1 2015-04-23 10:56:54 -04:00
Jonathan Kamens d39c0e830f Merge pull request #568 from quantopian/new_tweak_warnings_module
Scrubbing known warnings
2015-04-22 22:29:50 -04:00
Andrew Liang f44c15bb38 Scrubbing known warnings 2015-04-22 22:07:25 -04:00
Jonathan Kamens 74306f5d2d MAINT: Upgrade Markdown to 2.6.2 2015-04-22 21:12:44 -04:00
Jonathan Kamens 8ee7f6bd79 List dependencies before the things that depend on them
Because we use ordered_pip.sh to install requirements files, we want
dependencies in requirements_dev.txt to be listed _before_ the things
that depend on them, rather than after. Otherwise, with
ordered_pip.sh, stuff will get installed implicitly, and perhaps the
wrong version.
2015-04-22 16:06:33 -04:00
Eddie Hebert d343e06593 BUG: Remove use of defaultdict leading to memory growth.
defaultdict behavior was adding and never releasing a list and Timestamp
every time to_dict was called.
2015-04-22 10:46:20 -04:00
Eddie Hebert ec63397d28 BUG: Stop addition of new list in orders_by_modified on every dt.
Remove use of defaultdict for orders_by_modified, which was causing an
empty list to be added every time to_dict was called with a specified
dt.

Nnoticed in the minute emission case when hunting another memory leak,
every simulation minute a new Timestamp and list was created and never
let go.
2015-04-22 10:40:08 -04:00
warren-oneill fdd4940faf make calendar test compare generated calendar with the benchmark calendar
renaming cal_days to bench_days
2015-04-20 15:02:30 -04:00
Eddie Hebert 0fa44471be MAINT: Change expected type of treasury curves from load to DataFrame.
Instead of converting the curves back and forth from dictionaries to
DataFrame and back, use the DataFrame format when passing to
environment.
2015-04-20 10:26:09 -04:00
Brian Fink 82d2ddfa90 BUG: Fix limit orders
Only fill limit order if impacted fill price is better than the limit price.
If a limit order is partially filled, only fill the remaining shares if the
impacted fill price is better than the limit price.
2015-04-16 17:09:14 -04:00
Benjamin Berman ef598c7130 BUG: Handle a ValueError on from_csv calls
The cached market data could be corrupted. Pandas raises a ValueError in
that case, and this error handles it.
2015-04-14 12:40:37 -04:00
Scott Sanderson 885db87dea MAINT: Use logger instead of printing in loader.py
Makes it easier to filter logs when they're not desired.
2015-04-14 12:40:37 -04:00
Brian Fink 8baf52fe01 ENH: Add max leverage account guard 2015-04-10 15:19:54 -04:00
Brian Fink 2f895bddcd ENH: Track max leverage as risk 2015-04-10 15:19:54 -04:00
James Kirk 7af9b30a99 Merge pull request #560 from quantopian/calendar-clean
More flexible calendar implementation
2015-04-10 10:35:31 -04:00
Eddie Hebert 9bc40563b7 MAINT: Remove unused returns vector from perf tracker.
The returns Series in the perf tracker appears to be vestigial, so
remove.
2015-04-09 14:43:19 -04:00
warren-oneill 61571601ac added test for initialization of max_date in TradingEnvironment and removed trading_day from max_date if statement. 2015-04-08 16:57:32 -04:00
warren-oneill b62fadc76f adding NYSE trading_day and trading_days as default in load_market_data() 2015-04-08 16:57:23 -04:00
warren-oneill aa872afdf4 adding updates from master 2015-04-08 16:57:12 -04:00
warren-oneill 6432631981 uncommenting out test_calendar_vs_environment 2015-04-08 16:57:01 -04:00
warren-oneill 358d2a3b59 remove hardcoding of get_early_closes and passing trading_day and trading_days from env to load() 2015-04-08 16:56:52 -04:00
warren-oneill 49c168b3d0 adding trading_day and trading_days as variables to load_market_data 2015-04-08 16:56:13 -04:00
Thomas Wiecki d578d5825e BUG: Filter nans in DataFrame and Panel sources.
If a SID hasn't started trading yet, pandas' convention is to use nans.
Before this change, zipline would raise an exception if there were nans in the
input data.

We now skip events where the prices contains a nan and has not been traded
before (in which case forward fill).

Fixes #446.
2015-04-08 17:00:22 +02:00
Thomas Wiecki a257a43e99 DOC: Fix DataFrame and Panel sources doc strings. 2015-04-08 17:00:22 +02:00
Eddie Hebert 0821d3cad4 MAINT: Remove unused functions.
Found no references to these functions, so remove.
2015-04-06 16:43:35 -04:00
Jonathan Kamens 09c787829b MAINT: Upgrade nose to 1.3.6 2015-04-06 12:13:03 -04:00
Jonathan Kamens 80a704ff80 MAINT: Upgrade python-dateutil to 2.4.2 2015-04-02 20:16:36 -04:00
John Ricklefs b6b5275e67 MAINT: Downgrade Logbook to 0.6.0 2015-03-31 14:17:13 -04:00