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

Support Enumerations #2425

Closed
danbills opened this issue Jul 6, 2017 · 9 comments
Closed

Support Enumerations #2425

danbills opened this issue Jul 6, 2017 · 9 comments

Comments

@danbills
Copy link
Contributor

danbills commented Jul 6, 2017

It would be nice to restrict types to specific values so that users can only specify one of a limited number of a values.

Per this forum post

@cjllanwarne
Copy link
Contributor

Could be a nice bring-along with #2283

@patmagee
Copy link

Just wondering if there has been any discussion regarding this.

@katevoss
Copy link

@patmagee not to my knowledge but I can start the ball rolling.
@geoffjentry & @mcovarr, any opinions on supporting enums?

@geoffjentry
Copy link
Contributor

I'm leery but not necessarily against it. I'm also generally the one with the most conservative opinion in terms of adding WDL syntax, so view that take as a lower bound of acceptance :)

@patmagee what were you thinking in terms of the syntax?

Pinging @vdauwera so she's abreast of this convo.

@vdauwera
Copy link
Contributor

FWIW Enum support would definitely be very valuable to us in GATK-world, and are likely to be useful in general.

My one caveat would be that they should be easier to work with than they were in Queue (friendly elbow poke at @kshakir).

@patmagee
Copy link

patmagee commented Sep 1, 2017

@geoffjentry I share your concern with adding any sort of syntax to the spec, and my first inclination is to fake support enumeration. Im not exactly sure how to do that though, nor am I sure of whether its possible.

The cleanest way I can think of implementing would be maybe something like a Java style enum:

enum MyEnum {
     "A","B","C"
}

workflow wf {
    MyEnum thisIsMyEnum
}

Another way that we would be able to do it would be define an Enum type in a workflow like so:

workflow wf {
     #This would get overridden at run time, but the value would need to be validated
     Enum greeting = ["HELLO","GOODBYE"]
     or
     #Done override anything but validate it
     Enum["HELLO","GOODBYE"] greeting
     
}

@katevoss
Copy link

@geoffjentry sounds like this is more of a WDL feature request, shall I move it to the WDL repo?

@geoffjentry
Copy link
Contributor

628b747f8ccdfb757062f36a27eedecfc2295f515c0586e05fbfb0620c0571a2

@katevoss
Copy link

Issue moved to broadinstitute/wdl #139 via ZenHub

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

No branches or pull requests

6 participants