Skip to content

Commit

Permalink
Modify the Feature to be case sensitive (#589)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhupr authored Sep 10, 2021
1 parent 2759e8c commit 5e82c18
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions qlib/data/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ class Feature(Expression):

def __init__(self, name=None):
if name:
self._name = name.lower()
self._name = name
else:
self._name = type(self).__name__.lower()
self._name = type(self).__name__

def __str__(self):
return "$" + self._name
Expand Down
2 changes: 1 addition & 1 deletion qlib/data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ def __init__(self, **kwargs):

def feature(self, instrument, field, start_index, end_index, freq):
# validate
field = str(field).lower()[1:]
field = str(field)[1:]
instrument = code_to_fname(instrument)
return self.backend_obj(instrument=instrument, field=field, freq=freq)[start_index : end_index + 1]

Expand Down

0 comments on commit 5e82c18

Please sign in to comment.