Skip to content

Commit 6f610b7

Browse files
authored
fix bugs in type hints (#77)
Co-authored-by: Sikai Yao <yaosk@dp.tech>
1 parent c48b0b2 commit 6f610b7

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

dpgen2/flow/dpgen_loop.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
argo_len,
1515
argo_sequence,
1616
if_expression,
17+
OPTemplate,
1718
)
1819
from dflow.python import(
1920
PythonOPTemplate,
@@ -114,7 +115,7 @@ class ConcurrentLearningLoop(Steps):
114115
def __init__(
115116
self,
116117
name : str,
117-
block_op : Steps,
118+
block_op : OPTemplate,
118119
step_config : dict = normalize_step_dict({}),
119120
upload_python_package : str = None,
120121
):
@@ -201,7 +202,7 @@ class ConcurrentLearning(Steps):
201202
def __init__(
202203
self,
203204
name : str,
204-
block_op : Steps,
205+
block_op : OPTemplate,
205206
step_config : dict = normalize_step_dict({}),
206207
upload_python_package : str = None,
207208
):
@@ -292,7 +293,7 @@ def _loop (
292293
steps,
293294
step_keys,
294295
name : str,
295-
block_op : OP,
296+
block_op : OPTemplate,
296297
step_config : dict = normalize_step_dict({}),
297298
upload_python_package : str = None,
298299
):

dpgen2/superop/block.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
argo_range,
1414
argo_len,
1515
argo_sequence,
16+
OPTemplate,
1617
)
1718
from dflow.python import(
1819
PythonOPTemplate,
@@ -34,10 +35,10 @@ class ConcurrentLearningBlock(Steps):
3435
def __init__(
3536
self,
3637
name : str,
37-
prep_run_dp_train_op : OP,
38-
prep_run_lmp_op : OP,
38+
prep_run_dp_train_op : OPTemplate,
39+
prep_run_lmp_op : OPTemplate,
3940
select_confs_op : OP,
40-
prep_run_fp_op : OP,
41+
prep_run_fp_op : OPTemplate,
4142
collect_data_op : OP,
4243
select_confs_config : dict = normalize_step_dict({}),
4344
collect_data_config : dict = normalize_step_dict({}),
@@ -133,10 +134,10 @@ def _block_cl(
133134
block_steps : Steps,
134135
step_keys : List[str],
135136
name : str,
136-
prep_run_dp_train_op : OP,
137-
prep_run_lmp_op : OP,
137+
prep_run_dp_train_op : OPTemplate,
138+
prep_run_lmp_op : OPTemplate,
138139
select_confs_op : OP,
139-
prep_run_fp_op : OP,
140+
prep_run_fp_op : OPTemplate,
140141
collect_data_op : OP,
141142
select_confs_config : dict = normalize_step_dict({}),
142143
collect_data_config : dict = normalize_step_dict({}),

0 commit comments

Comments
 (0)