Skip to content

Commit

Permalink
0.9.61 新增 pyd 打包支持
Browse files Browse the repository at this point in the history
  • Loading branch information
zengbin93 committed Nov 22, 2024
1 parent 8c10406 commit 39a5041
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions czsc/utils/st_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -1541,8 +1541,8 @@ def show_strategies_recent(df, **kwargs):
)

# 计算每个时间段的盈利策略数量
win_count = n_rets.applymap(lambda x: 1 if x > 0 else 0).sum(axis=0)
win_rate = n_rets.applymap(lambda x: 1 if x > 0 else 0).sum(axis=0) / n_rets.shape[0]
win_count = n_rets.map(lambda x: 1 if x > 0 else 0).sum(axis=0)
win_rate = n_rets.map(lambda x: 1 if x > 0 else 0).sum(axis=0) / n_rets.shape[0]
dfs = pd.DataFrame({"盈利策略数量": win_count, "盈利策略比例": win_rate}).T
dfs = dfs.style.background_gradient(cmap="RdYlGn_r", axis=1).format("{:.4f}", na_rep="-")
st.dataframe(dfs, use_container_width=True)
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Cython
requests>=2.24.0
pyecharts>=1.9.1
tqdm>=4.66.4
Expand Down
11 changes: 10 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# coding: utf-8
import czsc
from os import path
from setuptools import setup, find_packages
from setuptools import setup, find_packages, Extension
from Cython.Build import cythonize

here = path.abspath(path.dirname(__file__))

Expand All @@ -11,6 +12,11 @@
with open(path.join(here, "requirements.txt"), encoding="utf-8") as f:
install_requires = f.read().strip().split("\n")

extensions = [
Extension("czsc", ["czsc/*.py"]),
]


setup(
name="czsc",
version=czsc.__version__,
Expand All @@ -24,6 +30,7 @@
url="https://github.com/waditu/czsc",
packages=find_packages(exclude=["test", "images", "docs", "examples", "hist"]),
include_package_data=True,
ext_modules=cythonize(extensions),
install_requires=install_requires,
package_data={"": ["utils/china_calendar.feather", "utils/minutes_split.feather"]},
classifiers=[
Expand All @@ -41,3 +48,5 @@
],
},
)

# 打包 pyd:python setup.py build_ext --inplace

0 comments on commit 39a5041

Please sign in to comment.