mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-08-08 04:27:44 +00:00
fix: Fixed some bugs introduced during refactoring. (#167)
* Fixed some bugs introduced during refactoring. * fix a minor bug * build factor source data (price and volumns) from qlib if no source data is provided by the user (#168) * Fixed some bugs introduced during refactoring. * fix a small bug * fix a small bug --------- Co-authored-by: Xu Yang <peteryang@vip.qq.com>
This commit is contained in:
@@ -24,7 +24,13 @@ class LoopMeta(type):
|
||||
@staticmethod
|
||||
def _get_steps(bases):
|
||||
"""
|
||||
get all the `steps` of base classes and combine them to a single one.
|
||||
Recursively get all the `steps` from the base classes and combine them into a single list.
|
||||
|
||||
Args:
|
||||
bases (tuple): A tuple of base classes.
|
||||
|
||||
Returns:
|
||||
List[Callable]: A list of steps combined from all base classes.
|
||||
"""
|
||||
steps = []
|
||||
for base in bases:
|
||||
@@ -34,7 +40,17 @@ class LoopMeta(type):
|
||||
return steps
|
||||
|
||||
def __new__(cls, clsname, bases, attrs):
|
||||
# move custommized steps into steps
|
||||
"""
|
||||
Create a new class with combined steps from base classes and current class.
|
||||
|
||||
Args:
|
||||
clsname (str): Name of the new class.
|
||||
bases (tuple): Base classes.
|
||||
attrs (dict): Attributes of the new class.
|
||||
|
||||
Returns:
|
||||
LoopMeta: A new instance of LoopMeta.
|
||||
"""
|
||||
steps = LoopMeta._get_steps(bases) # all the base classes of parents
|
||||
for name, attr in attrs.items():
|
||||
if not name.startswith("__") and isinstance(attr, Callable):
|
||||
|
||||
Reference in New Issue
Block a user