登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
Gitee AI
NEW
我知道了
查看详情
登录
注册
12月28日,「开源中国源创会年终盛典」珠海站再次回归!点击免费报名参会
代码拉取完成,页面将自动刷新
开源项目
>
WEB应用开发
>
Web开发框架
&&
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
5
Star
14
Fork
5
隐语SecretFlow
/
secretpad
代码
Issues
6
Pull Requests
0
Wiki
统计
流水线
服务
Gitee Pages
JavaDoc
PHPDoc
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
我知道了,不再自动展开
更新失败,请稍后重试!
Issues
/
详情
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
缺少扩展组件开发的详细文档帮助开发和单元测试提升质量和效率
待办的
#IAOSW7
kevin
创建于
2024-09-04 16:02
### Issue Type Others ### Have you searched for existing documents and issues? Yes ### OS Platform and Distribution EulerOS2.0 ### All_in_one Version 1.7.0b0 ### Module type secretpad ### Module version 0.8.1b0 ### What happend and What you expected to happen. ```shell 想开发一个扩展组件,目前只有一个compare的示例,缺少对扩展组件从架构,开发到单元测试等工程化的详细文档,直接看代码里面的写法也有好多种场景,需要花大量的时间摸索出符合自己需要的场景写法,并且单元测试过程中遇到了很多问题。 ``` ### Log output. ```shell 问题1: 1. 加密计算过程中,dtype不能为object,代码片段如下: max_iter=1000 input_spu_train_object和input_spu_test_object被spu前的数据结构: data = pd.DataFrame( data=[ [0.016, 0.827, 1., 0.333, 1], [0.335, 0.464, 1., 0.667, 0], [0.291, 0.564, 1., 0.667, 1], [0.35, 0.645, 0.5, 0.667, 0], ], columns=[ "f1", "f2","f3", "f4","label", ], ) 执行语句: output_spu_obj = spu( ROILinearProbeEvaluation, num_returns_policy=SPUCompilerNumReturnsPolicy.FROM_USER, user_specified_num_returns=2, )(input_spu_train_object,input_spu_test_object,max_iter) 报错问题: x = array(<function SPU.__call__.<locals>.wrapper at 0xffff957f3760>, dtype=object) def dtype(x: Any, *, canonicalize: bool = False) -> DType: """Return the dtype object for a value or type, optionally canonicalized based on X64 mode.""" if x is None: raise ValueError(f"Invalid argument to dtype: {x}.") is_type = isinstance(x, type) if is_type and x in python_scalar_dtypes: dt = python_scalar_dtypes[x] elif type(x) in python_scalar_dtypes: dt = python_scalar_dtypes[type(x)] elif is_type and _issubclass(x, np.generic): return np.dtype(x) elif issubdtype(getattr(x, 'dtype', None), extended): dt = x.dtype else: try: dt = np.result_type(x) except TypeError as err: raise TypeError(f"Cannot determine dtype of {x}") from err if dt not in _jax_dtype_set and not issubdtype(dt, extended): > raise TypeError(f"Value '{x}' with dtype {dt} is not a valid JAX array " "type. Only arrays of numeric types are supported by JAX.") E TypeError: Value '<function SPU.__call__.<locals>.wrapper at 0xffff957f3760>' with dtype object is not a valid JAX array type. Only arrays of numeric types are supported by JAX. 问题2:标识有@pytest.mark.parametrize的场景无法进入断点调试,直接跳过 Received JSON data in run script Running pytest with args: ['-p', 'vscode_pytest', '--rootdir=/mnt/root/secretflow', '--capture=no', '/mnt/root/secretflow/tests/component/ml/test_ss_sgd.py::test_ss_sgd[SF_PARTY_PREFIX_alice-False]'] ============================= test session starts ============================== platform linux -- Python 3.10.14, pytest-8.3.2, pluggy-1.5.0 rootdir: /mnt/root/secretflow configfile: pytest.ini plugins: xdist-3.6.1 Fixture names for test_ss_sgd[SF_PARTY_PREFIX_alice-False]: ['sf_party_for_4pc', 'comp_prod_sf_cluster_config', 'with_checkpoint', 'request'] collected 1 item tests/component/ml/test_ss_sgd.py s =============================== warnings summary =============================== secretflow/data/core/pandas/dataframe.py:19 secretflow/data/core/pandas/dataframe.py:19 /mnt/root/secretflow/secretflow/data/core/pandas/dataframe.py:19: DeprecationWarning: jax.tree_map is deprecated: use jax.tree.map (jax v0.4.25 or newer) or jax.tree_util.tree_map (any JAX version). from jax import tree_map ../../miniforge3/lib/python3.10/site-packages/cleantext/clean.py:77: 31 warnings /mnt/miniforge3/lib/python3.10/site-packages/cleantext/clean.py:77: DeprecationWarning: The parameter 'use_aliases' in emoji.demojize() is deprecated and will be removed in version 2.0.0. Use language='alias' instead. To hide this warning, pin/downgrade the package to 'emoji~=1.6.3' text = demojize(text, use_aliases=True) ../../miniforge3/lib/python3.10/site-packages/cleantext/clean.py:91: 31 warnings /mnt/miniforge3/lib/python3.10/site-packages/cleantext/clean.py:91: DeprecationWarning: The parameter 'use_aliases' in emoji.emojize() is deprecated and will be removed in version 2.0.0. Use language='alias' instead. To hide this warning, pin/downgrade the package to 'emoji~=1.6.3' text = emojize(text, use_aliases=True) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ======================= 1 skipped, 64 warnings in 2.97s ======================== 目前使用的vscode进行单元测试,基本都是参考网上的教程进行的pytest的配置,非参数化定义的场景都能正常测试过程。 ```
### Issue Type Others ### Have you searched for existing documents and issues? Yes ### OS Platform and Distribution EulerOS2.0 ### All_in_one Version 1.7.0b0 ### Module type secretpad ### Module version 0.8.1b0 ### What happend and What you expected to happen. ```shell 想开发一个扩展组件,目前只有一个compare的示例,缺少对扩展组件从架构,开发到单元测试等工程化的详细文档,直接看代码里面的写法也有好多种场景,需要花大量的时间摸索出符合自己需要的场景写法,并且单元测试过程中遇到了很多问题。 ``` ### Log output. ```shell 问题1: 1. 加密计算过程中,dtype不能为object,代码片段如下: max_iter=1000 input_spu_train_object和input_spu_test_object被spu前的数据结构: data = pd.DataFrame( data=[ [0.016, 0.827, 1., 0.333, 1], [0.335, 0.464, 1., 0.667, 0], [0.291, 0.564, 1., 0.667, 1], [0.35, 0.645, 0.5, 0.667, 0], ], columns=[ "f1", "f2","f3", "f4","label", ], ) 执行语句: output_spu_obj = spu( ROILinearProbeEvaluation, num_returns_policy=SPUCompilerNumReturnsPolicy.FROM_USER, user_specified_num_returns=2, )(input_spu_train_object,input_spu_test_object,max_iter) 报错问题: x = array(<function SPU.__call__.<locals>.wrapper at 0xffff957f3760>, dtype=object) def dtype(x: Any, *, canonicalize: bool = False) -> DType: """Return the dtype object for a value or type, optionally canonicalized based on X64 mode.""" if x is None: raise ValueError(f"Invalid argument to dtype: {x}.") is_type = isinstance(x, type) if is_type and x in python_scalar_dtypes: dt = python_scalar_dtypes[x] elif type(x) in python_scalar_dtypes: dt = python_scalar_dtypes[type(x)] elif is_type and _issubclass(x, np.generic): return np.dtype(x) elif issubdtype(getattr(x, 'dtype', None), extended): dt = x.dtype else: try: dt = np.result_type(x) except TypeError as err: raise TypeError(f"Cannot determine dtype of {x}") from err if dt not in _jax_dtype_set and not issubdtype(dt, extended): > raise TypeError(f"Value '{x}' with dtype {dt} is not a valid JAX array " "type. Only arrays of numeric types are supported by JAX.") E TypeError: Value '<function SPU.__call__.<locals>.wrapper at 0xffff957f3760>' with dtype object is not a valid JAX array type. Only arrays of numeric types are supported by JAX. 问题2:标识有@pytest.mark.parametrize的场景无法进入断点调试,直接跳过 Received JSON data in run script Running pytest with args: ['-p', 'vscode_pytest', '--rootdir=/mnt/root/secretflow', '--capture=no', '/mnt/root/secretflow/tests/component/ml/test_ss_sgd.py::test_ss_sgd[SF_PARTY_PREFIX_alice-False]'] ============================= test session starts ============================== platform linux -- Python 3.10.14, pytest-8.3.2, pluggy-1.5.0 rootdir: /mnt/root/secretflow configfile: pytest.ini plugins: xdist-3.6.1 Fixture names for test_ss_sgd[SF_PARTY_PREFIX_alice-False]: ['sf_party_for_4pc', 'comp_prod_sf_cluster_config', 'with_checkpoint', 'request'] collected 1 item tests/component/ml/test_ss_sgd.py s =============================== warnings summary =============================== secretflow/data/core/pandas/dataframe.py:19 secretflow/data/core/pandas/dataframe.py:19 /mnt/root/secretflow/secretflow/data/core/pandas/dataframe.py:19: DeprecationWarning: jax.tree_map is deprecated: use jax.tree.map (jax v0.4.25 or newer) or jax.tree_util.tree_map (any JAX version). from jax import tree_map ../../miniforge3/lib/python3.10/site-packages/cleantext/clean.py:77: 31 warnings /mnt/miniforge3/lib/python3.10/site-packages/cleantext/clean.py:77: DeprecationWarning: The parameter 'use_aliases' in emoji.demojize() is deprecated and will be removed in version 2.0.0. Use language='alias' instead. To hide this warning, pin/downgrade the package to 'emoji~=1.6.3' text = demojize(text, use_aliases=True) ../../miniforge3/lib/python3.10/site-packages/cleantext/clean.py:91: 31 warnings /mnt/miniforge3/lib/python3.10/site-packages/cleantext/clean.py:91: DeprecationWarning: The parameter 'use_aliases' in emoji.emojize() is deprecated and will be removed in version 2.0.0. Use language='alias' instead. To hide this warning, pin/downgrade the package to 'emoji~=1.6.3' text = emojize(text, use_aliases=True) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ======================= 1 skipped, 64 warnings in 2.97s ======================== 目前使用的vscode进行单元测试,基本都是参考网上的教程进行的pytest的配置,非参数化定义的场景都能正常测试过程。 ```
评论 (
0
)
kevin
创建了
任务
登录
后才可以发表评论
状态
待办的
待办的
进行中
已完成
已关闭
负责人
未设置
标签
未设置
标签管理
里程碑
未关联里程碑
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
分支 (7)
标签 (15)
main
release/0.11.x
release/0.10.x
release/0.9.x
release/0.8.x
release/0.7.x
release/0.6.x
v0.11.0b0
v0.10.1b0
v0.10.0b0
v0.9.0b0
v0.8.1b0
v0.8.0b0
v0.7.2b0
v0.7.1b0
v0.7.0b0
v0.6.0b0
v0.5.0b0
v0.4.1b0
v0.4.0b0
v0.3.0b0
v0.2.0b0
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
参与者(1)
1
https://gitee.com/secretflow/secretpad.git
git@gitee.com:secretflow/secretpad.git
secretflow
secretpad
secretpad
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册