1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-10 14:26:56 +08:00

Modify the Feature to be case sensitive (#589)

This commit is contained in:
Pengrong Zhu
2021-09-10 11:47:23 +08:00
committed by GitHub
parent 2759e8c28d
commit 5e82c18cb2
2 changed files with 3 additions and 3 deletions

View File

@@ -196,9 +196,9 @@ class Feature(Expression):
def __init__(self, name=None): def __init__(self, name=None):
if name: if name:
self._name = name.lower() self._name = name
else: else:
self._name = type(self).__name__.lower() self._name = type(self).__name__
def __str__(self): def __str__(self):
return "$" + self._name return "$" + self._name

View File

@@ -670,7 +670,7 @@ class LocalFeatureProvider(FeatureProvider):
def feature(self, instrument, field, start_index, end_index, freq): def feature(self, instrument, field, start_index, end_index, freq):
# validate # validate
field = str(field).lower()[1:] field = str(field)[1:]
instrument = code_to_fname(instrument) instrument = code_to_fname(instrument)
return self.backend_obj(instrument=instrument, field=field, freq=freq)[start_index : end_index + 1] return self.backend_obj(instrument=instrument, field=field, freq=freq)[start_index : end_index + 1]