Commit Graph

1350 Commits

Author SHA1 Message Date
Jonathan Kamens e2f091c96e Upgrade nose-parameterized to 0.2 2013-01-21 09:37:37 -05:00
Eddie Hebert f017218b64 Uses class constants for message text instead of ndict.
Reducing use of ndict on the path to fixing a memory leak.

So that pulling an instance of ndict with objgraph is more likely
to be a use of ndict that is causing the leak.

Using a class level constant here suffices for the dot access
desired on messages.
2013-01-21 08:54:19 -05:00
Eddie Hebert b6779a85c7 Removes Jenkins configurations.
Public repo uses Travis-CI.
2013-01-21 01:01:27 -05:00
Eddie Hebert 39f44a44f8 Reverting changes MovingStandardDevWindow.
Though the addition of tracking mulitple values in the window
is powerful, the changes broke behavior of existing algorithms
by changing method signatures and names.

So temporarily reverting these changes, to be pulled back in when
a way to have the multiple fields tracked with the existing API
is written, or a cutover of the API is figured out and determined.
2013-01-21 00:12:33 -05:00
Eddie Hebert 9e31d83084 Fixes check of ticks in stddev, now that __len__ has been removed. 2013-01-17 18:11:27 -05:00
Eddie Hebert dbcfc0a2a5 Restores previous get_stddev method and uses the price value.
To maintain compatibility with existing algorithms.
2013-01-17 17:44:21 -05:00
Eddie Hebert 46b04ebe46 Merge pull request #63 from quantopian/transform_default_field
REF: fields now defaults to price for mavg and stddev transform. Also allows string specification.
2013-01-17 09:18:21 -08:00
Thomas Wiecki 685b2ed6fd REF: Fields is kwarg is MovingStandardDevWindow. 2013-01-17 12:10:09 -05:00
Thomas Wiecki eb1cb27a07 REF: fields now defaults to price for mavg and stddev transform. Also allows string specification. 2013-01-17 11:46:17 -05:00
Thomas Wiecki 0d6b8309b7 Merge branch 'master' of github.com:quantopian/zipline 2013-01-16 11:59:19 -05:00
Thomas Wiecki 4ab82601a5 Resolved unittest import problems. 2013-01-16 11:54:04 -05:00
Thomas Wiecki fd9bbbebfa Fix for stddev during merging. 2013-01-16 11:53:35 -05:00
Thomas Wiecki 77e9147a8b Merge branch 'master' of github.com:quantopian/zipline into stddev_multifield 2013-01-16 11:42:11 -05:00
Eddie Hebert 65138fbceb Uses numpy.dot instead numpy.vdot to calculate positions value.
Since the position amount and price ndarrays are one dimensional
and use real numbers, we do not need the overhead of the extra
case handling provided by numpy.vdot, which comes at a cost of
performance.

With thanks to @jlowin, for pointing out the better fit of numpy.dot.
2013-01-16 11:38:37 -05:00
Elektra58 d0640d56c8 Refactored stdev transform to be applied to multiple fields, not just price
UnitTest for transforms refactored to account for changed stdev transform, introduced AssertAlmostEqual
2013-01-16 10:33:38 -05:00
Eddie Hebert a2b1b1b71e Uses vdot and numpy arrays for position totals.
Gets almost 100x speed up over iterating over the values and
summing up the values in Python.

Farms out the work to numpy and atlas by using the vector dot
product of the amounts and last sale prices.

Adds some wiring of keeping track of an index into the numpy arrays
for each position, so that value can be overwritten as events update
those amounts and sale prices.
2013-01-16 10:30:38 -05:00
Eddie Hebert c044648275 Rolls over existing PerformancePeriod.
Instead of doing the rollover by creating a new PerformancePeriod,
introduces a `rollover` method that resets the values that need
to be fresh in a new period, and moves the ending values to starting
values, and leaves positions intact.

This isn't a major runtime improvement in of itself, but it does
allow us to more easily keep track of position values from period
to period, which other improvements will use.
2013-01-16 10:30:38 -05:00
Jonathan Kamens 61773a2ebe Upgrade requests module to 1.1.0 2013-01-16 10:30:38 -05:00
Eddie Hebert a3235bb1a5 Recycles objects for positions.
Instead of creating a new ndict for each position on every event,
we change the values in the object that held the previous position.

The creation of new objects on each event was incurring too much
overhead.

Changes the position type returned by performance module.

For improved speed, changes from ndict to a simple Python object,
since the cost of setting ndict values is too expensive for the
number of times that positions are returned.

Also, changes the containing type of the positions to be dictionary
with the __missing__ overloaded, instead of the ndict that had that
behavior, to reduce the penalty of using ndicts.
2013-01-16 10:30:38 -05:00
Eddie Hebert a889f814fc Recycles the portfolio container to be passed to handle_data.
The creation of a new portfolio ndict on each call of handle_data
was creating a very high performance overhead.

Instead, we use the same the portfolio object for each event,
and replace the values contained within.
2013-01-16 10:30:38 -05:00
Eddie Hebert 48dba943db Uses a Portfolio object instead of an ndict.
Gains some performance by using a 'regular' object instead of
an ndict.

Also, directly sets up the values that we return, instead of going in
between with __core_dict and then removing values.

In it's entirety performanc.as_portfolio is the current
highest bottleneck, working on reducing time spent in that function.
2013-01-16 10:30:38 -05:00
Thomas Wiecki 0ecdac83f4 DOC: Typo. 2013-01-16 10:30:38 -05:00
Thomas Wiecki abf482c2a6 MIN: Changed isinstance check to allow more types. 2013-01-16 10:30:38 -05:00
Thomas Wiecki 456639d02c ENH: New batch_transform feature: compute_only_full. 2013-01-16 10:30:37 -05:00
Thomas Wiecki 52b099f6db ENH: Added new kwarg to batch_transform: create_panel. 2013-01-16 10:30:37 -05:00
Thomas Wiecki a63d4bca28 ENH: sid and field filter kwargs can also be strings or ints. 2013-01-16 10:30:37 -05:00
Thomas Wiecki b815a57430 ENH: batch_transform now supports field filtering. 2013-01-16 10:30:37 -05:00
Thomas Wiecki b68c51afb4 ENH: batch_transform now supports sid-filtering. DOC: Added docs to batch_transform. 2013-01-16 10:30:37 -05:00
Eddie Hebert 018ac67966 Uses vdot and numpy arrays for position totals.
Gets almost 100x speed up over iterating over the values and
summing up the values in Python.

Farms out the work to numpy and atlas by using the vector dot
product of the amounts and last sale prices.

Adds some wiring of keeping track of an index into the numpy arrays
for each position, so that value can be overwritten as events update
those amounts and sale prices.
2013-01-14 21:47:14 -05:00
Eddie Hebert e7405d04ad Rolls over existing PerformancePeriod.
Instead of doing the rollover by creating a new PerformancePeriod,
introduces a `rollover` method that resets the values that need
to be fresh in a new period, and moves the ending values to starting
values, and leaves positions intact.

This isn't a major runtime improvement in of itself, but it does
allow us to more easily keep track of position values from period
to period, which other improvements will use.
2013-01-14 21:47:13 -05:00
Jonathan Kamens 3227ba49a4 Upgrade requests module to 1.1.0 2013-01-14 11:05:58 -05:00
Eddie Hebert fc031f9c39 Merge pull request #58 from quantopian/placeholder-object-in-performance-inner-loop
Recycles objects for portfolio and positions.
2013-01-12 13:57:01 -08:00
Eddie Hebert 34d577d3d7 Recycles objects for positions.
Instead of creating a new ndict for each position on every event,
we change the values in the object that held the previous position.

The creation of new objects on each event was incurring too much
overhead.

Changes the position type returned by performance module.

For improved speed, changes from ndict to a simple Python object,
since the cost of setting ndict values is too expensive for the
number of times that positions are returned.

Also, changes the containing type of the positions to be dictionary
with the __missing__ overloaded, instead of the ndict that had that
behavior, to reduce the penalty of using ndicts.
2013-01-12 15:37:18 -05:00
Eddie Hebert 1ddfadf5b4 Recycles the portfolio container to be passed to handle_data.
The creation of a new portfolio ndict on each call of handle_data
was creating a very high performance overhead.

Instead, we use the same the portfolio object for each event,
and replace the values contained within.
2013-01-12 15:35:49 -05:00
Eddie Hebert ca9fdcfe84 Uses a Portfolio object instead of an ndict.
Gains some performance by using a 'regular' object instead of
an ndict.

Also, directly sets up the values that we return, instead of going in
between with __core_dict and then removing values.

In it's entirety performanc.as_portfolio is the current
highest bottleneck, working on reducing time spent in that function.
2013-01-11 14:50:00 -05:00
Eddie Hebert df18dd1682 Merge pull request #54 from quantopian/enhance_batch_full_panel
Enhance batch full panel
2013-01-07 12:13:31 -08:00
Thomas Wiecki bf2e8e3586 DOC: Typo. 2013-01-07 13:26:27 -05:00
Richard Frank 471521f305 Merge pull request #53 from quantopian/performance-improvements-sorting-and-done-message
Performance improvements sorting and done message
2013-01-07 10:13:09 -08:00
Eddie Hebert ee02ff6445 Adds _ prefix to decorate_source to imply internal usage. 2013-01-07 13:03:12 -05:00
Thomas Wiecki 48b05397e2 MIN: Changed isinstance check to allow more types. 2013-01-07 12:50:52 -05:00
Thomas Wiecki 0f88e4133d ENH: New batch_transform feature: compute_only_full. 2013-01-07 12:44:55 -05:00
Thomas Wiecki d1dace948e ENH: Added new kwarg to batch_transform: create_panel. 2013-01-07 12:44:19 -05:00
Thomas Wiecki 5deeb38fb6 ENH: sid and field filter kwargs can also be strings or ints. 2013-01-07 12:44:00 -05:00
Thomas Wiecki 2729936aff ENH: batch_transform now supports field filtering. 2013-01-07 12:43:41 -05:00
Thomas Wiecki 0e3b1e76e8 ENH: batch_transform now supports sid-filtering. DOC: Added docs to batch_transform. 2013-01-07 12:43:26 -05:00
Eddie Hebert fc03e80cdf Removes done message.
Instead of checking for 'DONE' on each call uses generators
builtin StopIteration for signalling the end of input.
2013-01-07 12:06:31 -05:00
Eddie Hebert e7a31c0661 Removes sort module.
Sort module is now unneeded with use of heapq.merge

Also adapts test_perf_tracking so that it uses date_sorted_sources.
2013-01-07 12:06:10 -05:00
Eddie Hebert 13a2b1c637 Changes date_sort to use heapq module.
Uses heapq.merge to sort input from mulitple sources instead of
our own sort module.

From profiling heapq.merge is more efficient than our own efforts.
2013-01-07 12:03:50 -05:00
Eddie Hebert 0d841503a7 Uses dictionary update instead of iterating through keys.
update_universe is a bottleneck on large data sets.

A large portion of that bottleneck is the call to getitem while
looping over the keys, so using update while passing along the internal
__dict__

Seeing about a 40% improvement.
2013-01-06 17:31:03 -05:00
Eddie Hebert dd64bb0fbf Changes type emitted from DataSource to Event.
Moving DataSource to Event for improvements in member access
and setting.
2013-01-06 17:23:26 -05:00