Skip to content

Commit 8862af1

Browse files
authored
[930] Fix typo HasingStockStorage to HashingStockStorage. (microsoft#947)
1 parent a866b56 commit 8862af1

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

qlib/data/dataset/handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def _fetch_data(
257257
selector=selector, level=level, col_set=col_set, fetch_orig=self.fetch_orig, proc_func=proc_func
258258
)
259259
else:
260-
raise TypeError(f"data_storage should be pd.DataFrame|HasingStockStorage, not {type(data_storage)}")
260+
raise TypeError(f"data_storage should be pd.DataFrame|HashingStockStorage, not {type(data_storage)}")
261261

262262
if squeeze:
263263
# squeeze columns

qlib/data/dataset/processor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,6 @@ class HashStockFormat(Processor):
349349
"""Process the storage of from df into hasing stock format"""
350350

351351
def __call__(self, df: pd.DataFrame):
352-
from .storage import HasingStockStorage # pylint: disable=C0415
352+
from .storage import HashingStockStorage # pylint: disable=C0415
353353

354-
return HasingStockStorage.from_df(df)
354+
return HashingStockStorage.from_df(df)

qlib/data/dataset/storage.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ def is_proc_func_supported(self):
5959
raise NotImplementedError("is_proc_func_supported method is not implemented!")
6060

6161

62-
class HasingStockStorage(BaseHandlerStorage):
63-
"""Hasing data storage for datahanlder
62+
class HashingStockStorage(BaseHandlerStorage):
63+
"""Hashing data storage for datahanlder
6464
- The default data storage pandas.DataFrame is too slow when randomly accessing one stock's data
65-
- HasingStockStorage hashes the multiple stocks' data(pandas.DataFrame) by the key `stock_id`.
66-
- HasingStockStorage hashes the pandas.DataFrame into a dict, whose key is the stock_id(str) and value this stock data(panda.DataFrame), it has the following format:
65+
- HashingStockStorage hashes the multiple stocks' data(pandas.DataFrame) by the key `stock_id`.
66+
- HashingStockStorage hashes the pandas.DataFrame into a dict, whose key is the stock_id(str) and value this stock data(panda.DataFrame), it has the following format:
6767
{
6868
stock1_id: stock1_data,
6969
stock2_id: stock2_data,
@@ -82,7 +82,7 @@ def __init__(self, df):
8282

8383
@staticmethod
8484
def from_df(df):
85-
return HasingStockStorage(df)
85+
return HashingStockStorage(df)
8686

8787
def _fetch_hash_df_by_stock(self, selector, level):
8888
"""fetch the data with stock selector
@@ -153,5 +153,5 @@ def fetch(
153153
return pd.concat(fetch_stock_df_list, sort=False, copy=~fetch_orig)
154154

155155
def is_proc_func_supported(self):
156-
"""the arg `proc_func` in `fetch` method is not supported in HasingStockStorage"""
156+
"""the arg `proc_func` in `fetch` method is not supported in HashingStockStorage"""
157157
return False

tests/test_handler_storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def test_handler_storage(self):
9595
fetch_stocks = [instruments[_index] for _index in random_indexs]
9696
data_handler.fetch(selector=(fetch_stocks, slice(fetch_start_time, fetch_end_time)), level=None)
9797

98-
with TimeInspector.logt("random fetch with HasingStock Storage"):
98+
with TimeInspector.logt("random fetch with HashingStock Storage"):
9999

100100
# single stock
101101
for i in range(100):

0 commit comments

Comments
 (0)