mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-14 12:10:24 +08:00
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:
@@ -55,14 +55,14 @@ class WithPanelBarReader(WithAssetFinder):
|
||||
|
||||
cls.reader = PanelBarReader(trading_calendar, cls.panel, cls.FREQUENCY)
|
||||
|
||||
def test_spot_price(self):
|
||||
def test_get_value(self):
|
||||
panel = self.panel
|
||||
reader = self.reader
|
||||
|
||||
for asset, date, field in product(*panel.axes):
|
||||
self.assertEqual(
|
||||
panel.loc[asset, date, field],
|
||||
reader.spot_price(asset, date, field),
|
||||
reader.get_value(asset, date, field),
|
||||
)
|
||||
|
||||
def test_duplicate_values(self):
|
||||
|
||||
Reference in New Issue
Block a user