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

Generalize size function to operate on any collection-typed input #531

Closed
jdidion opened this issue Jan 25, 2023 · 0 comments
Closed

Generalize size function to operate on any collection-typed input #531

jdidion opened this issue Jan 25, 2023 · 0 comments
Assignees
Milestone

Comments

@jdidion
Copy link
Collaborator

jdidion commented Jan 25, 2023

The size function is very useful for determining the sizes of inputs, such that the size requested in the disks runtime attribute can be determined dynamically. However, the usefulness of size is limited by the fact that it can only operate on File and Array[File]. For more complex inputs it is common to bundle multiple files together into a collection, e.g.

struct Fastqs {
  File read1
  File? read2
  Boolean? interleaved
}

task foo {
  input {
    Array[Fastqs] sample_fastqs
  }
  ...
}

I propose that we change the signature of size to:

Float size(X?, [String])

where X is either File or a compound type (Array, Map, Pair, Object, or struct) that contains File?s. The output is the sum of all sizes of all files contained within the argument value to any level of nesting.

Draft implementation: https://github.com/openwdl/wdl/tree/531-generalize-size

@jdidion jdidion added this to the 1.2 milestone Jan 25, 2023
@jdidion jdidion changed the title Generalize size function to operate on collection-typed inputs Generalize size function to operate on any collection-typed input Jan 25, 2023
@jdidion jdidion self-assigned this Mar 25, 2023
@jdidion jdidion assigned jdidion and unassigned jdidion Mar 28, 2024
@jdidion jdidion closed this as completed May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

1 participant