MAINT: Standardize reader get value methods.

The daily/session bar reader's `spot_price` took the same parameters and
returned the same kind of output as the minute bar reader's `get_value`.

Standardize on one method to make a common interface, which may be
formally factored out in a later patch; to help enable writing reader
implementations or mixins which can be agnostic to the bar frequency.
This commit is contained in:
Eddie Hebert
2016-08-24 12:46:36 -04:00
parent 20f9241252
commit a3c1f4ce36
10 changed files with 38 additions and 40 deletions
+2 -2
View File
@@ -512,7 +512,7 @@ class TestResampleSessionBars(WithBcolzFutureMinuteBarReader,
self.assertEqual(self.END_DATE, session_bar_reader.last_available_dt)
def test_spot_price(self):
def test_get_value(self):
calendar = self.trading_calendar
session_bar_reader = MinuteResampleSessionBarReader(
calendar,
@@ -523,7 +523,7 @@ class TestResampleSessionBars(WithBcolzFutureMinuteBarReader,
for dt_str, values in expected.iterrows():
dt = pd.Timestamp(dt_str, tz='UTC')
for col in OHLCV:
result = session_bar_reader.spot_price(sid, dt, col)
result = session_bar_reader.get_value(sid, dt, col)
assert_almost_equal(values[col], result,
err_msg="sid={0} col={1} dt={2}".
format(sid, col, dt))