Skip to content

Fix/docker array secondaryfiles #170

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

Closed
wants to merge 2 commits into from
Closed

Fix/docker array secondaryfiles #170

wants to merge 2 commits into from

Conversation

jeremiahsavage
Copy link
Contributor

@kmhernan
Copy link

@jeremiahsavage @mr-c hmm so with more investigation, it seems like for v1.0 at least within the if schema["type"] == "array" block there will be no secondary files passed to this would not work. I did get it to work by doing this around line 70:

   elif isinstance(schema["type"], dict):
            st = copy.deepcopy(schema["type"])
            if binding and "inputBinding" not in st and st["type"] == "array" and "itemSeparator" not in binding:
                st["inputBinding"] = {}
            #-- KMH FIX
            if 'secondaryFiles' in schema: st['secondaryFiles'] = schema['secondaryFiles']
            bindings.extend(self.bind_input(st, datum, lead_pos=lead_pos, tail_pos=tail_pos))

then back in the block where the commits are placed in this PR, I have:

            if schema["type"] == "array":
                for n, item in enumerate(datum):
                    b2 = None
                    if binding:
                        b2 = copy.deepcopy(binding)
                        b2["datum"] = item
                    #-- KMH FIX
                    if 'secondaryFiles' in schema:
                        bindings.extend(
                            self.bind_input(
                                {"type": schema["items"], "inputBinding": b2, "secondaryFiles": schema['secondaryFiles']},
                                item, lead_pos=n, tail_pos=tail_pos))
                    else:
                        bindings.extend(
                            self.bind_input(
                                {"type": schema["items"], "inputBinding": b2},
                                item, lead_pos=n, tail_pos=tail_pos))
                binding = None

Now, the secondaryFiles will be seen for v1.0. But I don't know if this is a bad approach? I have tested this using the 1.0.20160913171024 build of cwltool.

@jeremiahsavage
Copy link
Contributor Author

jeremiahsavage commented Oct 13, 2016

@kmhernan I'll try testing your patch for v1.0

One problem there might be for v1.0, is that the spec removed mention of secondaryFiles in InputArraySchema, while it was present in the draft-3 spec.

See secondaryFile in draft-3:
5.4.1.1.2 InputArraySchema http://www.commonwl.org/draft-3/CommandLineTool.html#InputArraySchema
absent in v1.0:
5.4.2.2 InputArraySchema http://www.commonwl.org/v1.0/CommandLineTool.html#InputArraySchema

@tetron
Copy link
Member

tetron commented Oct 14, 2016

Thanks for looking into this. I have a fix pending in #211

@cwl-bot
Copy link

cwl-bot commented Nov 15, 2016

Can one of the admins verify this patch?

@tetron
Copy link
Member

tetron commented Mar 22, 2018

Thanks, I believe this is fixed so I'm closing the PR.

@tetron tetron closed this Mar 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants