Two reasons for removal:
- On the path of removing most non-postconditional asserts.
Since the asserts on every message is incurring a
non-insignificant penalty on large datasets.
- Since the assert was invoked as a function, the 'right side'
of the assert statement, i.e. the error message was being invoked
as a function, discovered since the __repr__ of the message was
high on the bottleneck list.
The main bottle neck here was using `len`.
A boolean check is a sufficient test for more items in the queue.
Also, uses all instead of several functions.
When run over large amounts of data the use of ndict's gets and sets
become a large bottleneck, around 1/5th of the CPU time is spent
in ndict's __setattr__, __getattr__, etc.
By switching to an object for an event,
we reduce the penalty significantly.
Removes asserts that check for event being an ndict, as well as those
that assume a certain behavior of the __contains__ method for events.
In a previous patch, the transform argument had been changed
from days to window_length.
The README example was thus not able to be run, updating algo
so that it runs against current versions of transforms.
Moving to main requirements, since zipline will not run without
the treasury and benchmark data that we requests to fetch.
Upgrade is to keep current with latest release.
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.
To handle, for instance, Columbus Day (Oct 10),
on which there is no treasury data.
We're only forward-filling data now, and
no longer searching both back and forward in time.
Updated the search for treasury data when there is none for the
test end date.
It could be that the end date is not a trading day, or we could
just be missing treasury data. In either case, we try to recover
more gracefully now, by searching as far as possible and maybe
logging a warning.
Similarly, if there is no benchmark data for the test end date,
look for the next trading day. If we really have no data,
blow up with our own explicit exception, instead of overflowing
in our search for dates in the future.
Previously, keys that mapped to functions would be set as field names.
Attempting to assign the datapanel slot to a function causes an error.
This limits the extracted field names to those that map to an int
or a float.