Skip to content

Commit

Permalink
fix: HDF5Datasets with pool_size
Browse files Browse the repository at this point in the history
fix: with_param=range with group_size

Signed-off-by: zjgemi <[email protected]>
  • Loading branch information
zjgemi committed Sep 4, 2024
1 parent b12a8e7 commit 357918e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/dflow/python/opio.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class HDF5Dataset:
def __init__(self, dataset):
self.dataset = dataset

def __deepcopy__(self, memo=None):
return self

def get_data(self):
data = self.dataset[()]
if self.dataset.attrs.get("dtype") == "utf-8":
Expand Down
6 changes: 3 additions & 3 deletions src/dflow/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,9 +722,9 @@ def merge_output_artifact(art, parent, layer=0):
nslices = argo_len(self.with_param)
old_slices = self.template.slices.slices
self.template.slices.slices = \
"[json.loads(r'''{{inputs.parameters.dflow_with_param}}"\
"''')[%s] for i in range({{item}}*%s, min(({{item}}+1)*%s"\
", {{inputs.parameters.dflow_nslices}}))]" % (
"[jsonpickle.loads(r'''{{inputs.parameters.dflow_with_par"\
"am}}''')[%s] for i in range({{item}}*%s, min(({{item}}+1"\
")*%s, {{inputs.parameters.dflow_nslices}}))]" % (
old_slices.replace("{{item}}", "shuffled[i]"
if self.template.slices.shuffle
else "i"), group_size, group_size)
Expand Down

0 comments on commit 357918e

Please sign in to comment.