Skip to content

Commit

Permalink
v3.2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
chen-001 committed Sep 26, 2022
1 parent 08666a1 commit 44ed5af
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 14 deletions.
4 changes: 2 additions & 2 deletions pure_ocean_breeze/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
一个量化多因子研究的框架,包含数据、回测、因子加工等方面的功能
"""

__updated__ = "2022-09-19 17:34:33"
__version__ = "3.2.8"
__updated__ = "2022-09-26 14:23:15"
__version__ = "3.2.9"
__author__ = "chenzongwei"
__author_email__ = "[email protected]"
__url__ = "https://github.com/chen-001/pure_ocean_breeze"
Expand Down
37 changes: 25 additions & 12 deletions pure_ocean_breeze/labor/process.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__updated__ = "2022-09-26 14:08:47"
__updated__ = "2022-09-26 14:18:10"

import warnings

Expand Down Expand Up @@ -2487,17 +2487,17 @@ def get_daily_factors_alter(self, func: Callable) -> None:
self.daily_factors = self.daily_factors[
self.daily_factors.index >= pd.Timestamp(str(STATES["START"]))
]
self.daily_factors = self.daily_factors.reset_index()
self.daily_factors = self.daily_factors.rename(
columns={list(self.daily_factors.columns)[0]: "date"}
)
self.daily_factors = self.daily_factors.drop_duplicates(
subset=["date"], keep="first"
)
self.daily_factors = self.daily_factors.set_index("date")
self.daily_factors.reset_index().to_feather(self.daily_factors_path)
if not STATES["NO_LOG"]:
logger.success("更新已完成")
self.daily_factors = self.daily_factors.reset_index()
self.daily_factors = self.daily_factors.rename(
columns={list(self.daily_factors.columns)[0]: "date"}
)
self.daily_factors = self.daily_factors.drop_duplicates(
subset=["date"], keep="first"
)
self.daily_factors = self.daily_factors.set_index("date")
self.daily_factors.reset_index().to_feather(self.daily_factors_path)
if not STATES["NO_LOG"]:
logger.success("更新已完成")

except Exception:
raise IOError(
Expand Down Expand Up @@ -3848,6 +3848,19 @@ def __init__(
func: Callable = None,
group: int = 10,
) -> None:
"""使用因子b的值大小,对因子a进行分组,并可以在组内进行某种操作
Parameters
----------
df_main : pd.DataFrame
要被分组并进行操作的因子
df_helper : pd.DataFrame
用来做分组的依据
func : Callable, optional
分组后,组内要进行的操作, by default None
group : int, optional
要分的组数, by default 10
"""
self.df_main = df_main
self.df_helper = df_helper
self.func = func
Expand Down
3 changes: 3 additions & 0 deletions 更新日志/version3.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## 更新日志🗓 — v3

* v3.2.9 — 2022.09.26
> 1. 给pure_helper增加说明
> 1. 修复了以mysql分钟数据更新因子值的类pure_fall的出现重复数据的潜在bug
* v3.2.8 — 2022.09.26
> 1. 修复了用分钟数据计算因子值时,数据重复的潜在bug
> 1. 增加了将因子值改为分组组号的函数to_group
Expand Down

0 comments on commit 44ed5af

Please sign in to comment.