quantopian/zipline — pull request #345 by ssanderson (2014-06-04 01:39:23+00:00)
Title: Support for '1m' History Frequency.

Overhauls `HistoryContainer` in prep to support '1m' frequency.

Major changes:

- Methods/variables referring to "day" have been renamed/generalized.
- `current_day_panel` became `buffer_panel`, which is now a `RollingPanel`
- `prior_day_panel` became a dictionary mapping `Frequency` objects to
"digest panels", which are instances of `RollingPanel`.

- Hard-coded daily rollover replaced with a notion of a "current window" for
each unique frequency managed by the panel.

- When the end of the current window is reached for a given frequency, we
compute an aggregate bar (code refers to this as a "digest"), which is
appended to a panel associated with that frequency.

- Window rollover dates are managed by a pair of dictionaries,
`cur_window_starts` and `cur_window_closes`. The `Frequency` class is
responsible for computing window bounds based on the open/close of the
previous window.

- Semantic change to the `open_price` field: `open_price` now always
contains the price of the first trade occurring in the given window.
Previously it contained the price of the first minute in the window,
returning NaN it the security happened not to trade in the first minute.

- `price` is now the only field that can be forward-filled.