Skip to content

Commit 78c602f

Browse files
committed
docs: refine BaseDataHandler and DataHandler docstrings
1 parent 0f325f8 commit 78c602f

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

qlib/data/dataset/handler.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,20 @@
2424

2525

2626
class BaseDataHandler(Serializable):
27-
"""This is an interface for data handler.
28-
It does not assume the internal data structure of the data handler.
29-
It only defines the interface for external users (use dataframe as the internal data structure).
27+
"""
28+
Interface for data handler.
29+
30+
This class does not assume the internal data structure of the data handler.
31+
It only defines the interface for external users (uses DataFrame as the internal data structure).
3032
3133
In the future, the data handler's more detailed implementation should be refactored. Here are some guidelines:
3234
3335
It covers several components:
36+
3437
- [data loader] -> internal representation of the data -> data preprocessing -> interface adaptor for the fetch interface
3538
- The workflow to combine them all:
36-
- The workflow may be very complicated. DataHandlerLP is one of the practices, but it can't satisfy all the requirements.
37-
So leaving the flexibility to the user to implement the workflow is a more reasonable choice.
38-
39+
The workflow may be very complicated. DataHandlerLP is one of the practices, but it can't satisfy all the requirements.
40+
So leaving the flexibility to the user to implement the workflow is a more reasonable choice.
3941
"""
4042

4143
def __init__(self, *args, **kwargs):
@@ -65,11 +67,11 @@ def fetch(
6567

6668
class DataHandler(BaseDataHandler):
6769
"""
68-
6970
The motivation of DataHandler:
70-
- it proivdes a implementation of BaseDataHandler that we implement it with
71-
- Handle response with a internal loaded dataframe
72-
- the dataframe is loaded by a data loader.
71+
72+
- It provides an implementation of BaseDataHandler that we implement with:
73+
- Handling responses with an internal loaded DataFrame
74+
- The DataFrame is loaded by a data loader.
7375
7476
The steps to using a handler
7577
1. initialized data handler (call by `init`).

0 commit comments

Comments
 (0)