Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP fix #1330 #1566

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cwltool/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,10 @@ def _init_job(
)

job = copy.deepcopy(joborder)
if len(job.keys()) > 0:
for jo in joborder:
field = shortname(jo)
job[field] = joborder[jo]

make_fs_access = getdefault(runtime_context.make_fs_access, StdFsAccess)
fs_access = make_fs_access(runtime_context.basedir)
Expand Down
9 changes: 5 additions & 4 deletions cwltool/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,11 @@ def job(
)

step_input = {}
for inp in self.tool["inputs"]:
field = shortname(inp["id"])
if not inp.get("not_connected"):
step_input[field] = job_order[inp["id"]]
for inp in job_order:
field = shortname(inp)
step_input[field] = job_order[inp]
# if not inp.get("not_connected"):
# step_input[field] = job_order[field]

try:
yield from self.embedded_tool.job(
Expand Down
2 changes: 2 additions & 0 deletions cwltool/workflow_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ def object_from_state(
incomplete: bool = False,
) -> Optional[CWLObjectType]:
inputobj = {} # type: CWLObjectType
for s in state.keys():
inputobj[s] = state[s].value
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can avoid accessing keys & values separately. Something like:

for k, v in state.items():
  inputobj[k] = v

Or start inputobj by deep-cloning state.

Copy link
Contributor Author

@manabuishii manabuishii Mar 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current commited version is
https://github.com/common-workflow-language/cwltool/pull/1566/files#diff-ed87d61e2237460638e7f3ddb21bafc9969d8c142c804d79f94801142342f3d6R389-R391

My local version is following .
It handles 1330 well and pass py39-unit
But I can not pass py39-mypy

    for s in state.keys():
        if hasattr(state[s], "value"):
            inputobj[s] = state[s].value

Now I try to replace it to your code, because it looks good.
But I can not pass py39-mypy

    for k,v  in state.items():
        if type(v) is WorkflowStateItem:
            if hasattr(v, "value"):
                inputobj[k] = v.value

currently

for inp in parms:
iid = original_id = cast(str, inp["id"])
if frag_only:
Expand Down