mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-06 04:20:57 +08:00
@@ -359,7 +359,7 @@ class ExpressionCache(BaseProviderCache):
|
||||
def update(self, cache_uri: Union[str, Path], freq: str = "day"):
|
||||
"""Update expression cache to latest calendar.
|
||||
|
||||
Overide this method to define how to update expression cache corresponding to users' own cache mechanism.
|
||||
Override this method to define how to update expression cache corresponding to users' own cache mechanism.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
@@ -445,7 +445,7 @@ class DatasetCache(BaseProviderCache):
|
||||
def update(self, cache_uri: Union[str, Path], freq: str = "day"):
|
||||
"""Update dataset cache to latest calendar.
|
||||
|
||||
Overide this method to define how to update dataset cache corresponding to users' own cache mechanism.
|
||||
Override this method to define how to update dataset cache corresponding to users' own cache mechanism.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
@@ -543,7 +543,7 @@ class DiskExpressionCache(ExpressionCache):
|
||||
# instance
|
||||
series = self.provider.expression(instrument, field, _calendar[0], _calendar[-1], freq)
|
||||
if not series.empty:
|
||||
# This expresion is empty, we don't generate any cache for it.
|
||||
# This expression is empty, we don't generate any cache for it.
|
||||
with CacheUtils.writer_lock(self.r, f"{str(C.dpm.get_data_uri(freq))}:expression-{_cache_uri}"):
|
||||
self.gen_expression_cache(
|
||||
expression_data=series,
|
||||
@@ -858,7 +858,7 @@ class DiskDatasetCache(DatasetCache):
|
||||
"""gen_dataset_cache
|
||||
|
||||
.. note:: This function does not consider the cache read write lock. Please
|
||||
Aquire the lock outside this function
|
||||
Acquire the lock outside this function
|
||||
|
||||
The format the cache contains 3 parts(followed by typical filename).
|
||||
|
||||
@@ -1035,7 +1035,7 @@ class DiskDatasetCache(DatasetCache):
|
||||
# FIXME:
|
||||
# Because the feature cache are stored as .bin file.
|
||||
# So the series read from features are all float32.
|
||||
# However, the first dataset cache is calulated based on the
|
||||
# However, the first dataset cache is calculated based on the
|
||||
# raw data. So the data type may be float64.
|
||||
# Different data type will result in failure of appending data
|
||||
if "/{}".format(DatasetCache.HDF_KEY) in store.keys():
|
||||
|
||||
@@ -58,7 +58,7 @@ class Client:
|
||||
msg_proc_func : func
|
||||
the function to process the message when receiving response, should have arg `*args`.
|
||||
msg_queue: Queue
|
||||
The queue to pass the messsage after callback.
|
||||
The queue to pass the message after callback.
|
||||
"""
|
||||
head_info = {"version": qlib.__version__}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ from multiprocessing import Pool
|
||||
from typing import Iterable, Union
|
||||
from typing import List, Union
|
||||
|
||||
# For supporting multiprocessing in outter code, joblib is used
|
||||
# For supporting multiprocessing in outer code, joblib is used
|
||||
from joblib import delayed
|
||||
|
||||
from .cache import H
|
||||
|
||||
@@ -392,7 +392,7 @@ class TSDataSampler:
|
||||
2021-01-14 12441 12442 12443 12444 12445 12446 ...
|
||||
2) the second element: {<original index>: <row, col>}
|
||||
"""
|
||||
# object incase of pandas converting int to flaot
|
||||
# object incase of pandas converting int to float
|
||||
idx_df = pd.Series(range(data.shape[0]), index=data.index, dtype=object)
|
||||
idx_df = lazy_sort_index(idx_df.unstack())
|
||||
# NOTE: the correctness of `__getitem__` depends on columns sorted here
|
||||
|
||||
@@ -70,7 +70,7 @@ class DataHandler(Serializable):
|
||||
Parameters
|
||||
----------
|
||||
instruments :
|
||||
The stock list to retrive.
|
||||
The stock list to retrieve.
|
||||
start_time :
|
||||
start_time of the original data.
|
||||
end_time :
|
||||
|
||||
@@ -75,7 +75,7 @@ class Processor(Serializable):
|
||||
|
||||
def readonly(self) -> bool:
|
||||
"""
|
||||
Does the processor treat the input data readonly (i.e. does not write the input data) when processsing
|
||||
Does the processor treat the input data readonly (i.e. does not write the input data) when processing
|
||||
|
||||
Knowning the readonly information is helpful to the Handler to avoid uncessary copy
|
||||
"""
|
||||
|
||||
@@ -63,7 +63,7 @@ class HasingStockStorage(BaseHandlerStorage):
|
||||
"""Hasing data storage for datahanlder
|
||||
- The default data storage pandas.DataFrame is too slow when randomly accessing one stock's data
|
||||
- HasingStockStorage hashes the multiple stocks' data(pandas.DataFrame) by the key `stock_id`.
|
||||
- HasingStockStorage hases 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:
|
||||
- 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:
|
||||
{
|
||||
stock1_id: stock1_data,
|
||||
stock2_id: stock2_data,
|
||||
|
||||
Reference in New Issue
Block a user