question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support Enumerations

See original GitHub issue

@danbills commented on Thu Jul 06 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 commented on Mon Jul 10 2017

Could be a nice bring-along with https://github.com/broadinstitute/cromwell/issues/2283


@patmagee commented on Tue Aug 29 2017

Just wondering if there has been any discussion regarding this.


@katevoss commented on Tue Aug 29 2017

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


@geoffjentry commented on Tue Aug 29 2017

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 commented on Wed Aug 30 2017

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 commented on Fri Sep 01 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 commented on Thu Sep 28 2017

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


@geoffjentry commented on Thu Sep 28 2017

628b747f8ccdfb757062f36a27eedecfc2295f515c0586e05fbfb0620c0571a2

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:20 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jvlasblomcommented, May 4, 2022

I’m also interested in having support for enums in WDL. It would help with consistent error reporting, and generating UIs based on declared WDL inputs.

1reaction
vortexingcommented, Jan 3, 2022

OK. So right now, someone could specify String output_format = 'dam' and the task would fail for some dam reason, rather than having the workflow fail earlier before the task was actually sent/run b/c ‘dam’ is not one of the FileType’s allowed? That seems like a computational win to me when running someone else’s workflow. Just as long as how it gets done is aimed at newbies b/c the intent is to be more clear to users who don’t already know the enum values for such a param, I’m game.

Read more comments on GitHub >

github_iconTop Results From Across the Web

enum — Support for enumerations — Python 3.11.1 ...
enum — Support for enumerations¶ · is a set of symbolic names (members) bound to unique values · can be iterated over to...
Read more >
Enumeration types - C# reference - Microsoft Learn
Learn about C# enumeration types that represent a choice or a combination of choices.
Read more >
Enumeration declaration - cppreference.com
An enumeration is a distinct type whose value is restricted to a range of values (see below for details), which may include several ......
Read more >
enum in Python - GeeksforGeeks
Enumerations in Python are implemented by using the module named “enum“. ... Example 5: Enumerations support two types of comparisons.
Read more >
Build Enumerations of Constants With Python's Enum
Some programming languages, like Java and C++, include syntax that supports a data type known as enumerations, or just enums.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found