rune icon indicating copy to clipboard operation
rune copied to clipboard

Let users use a shorthand for types in their Runefiles

Open Michael-F-Bryan opened this issue 3 years ago • 1 comments

Each step in a Rune needs to explicitly mention the type of its outputs.

pipeline:
  content_image:
    capability: IMAGE
    outputs:
    - type: u8
      dimensions: [1, 384, 384, 3]

However, using a dict with type and dimensions keys can get a bit verbose (even when you write the list as [1, 384, 384, 3] instead of the normal bullet-point notation).

As an alternative, it'd be nice to use a shorthand.

pipeline:
  content_image:
    capability: IMAGE
    outputs:
    - u8[1, 384, 384, 3]

This could be implemented in a backwards compatible way by switching the Type struct to an untagged enum (in serde parlance).

CC: @f0rodo

Michael-F-Bryan avatar Aug 11 '21 18:08 Michael-F-Bryan

I think we also need a types field

types:
    $image_raw_type: u8[255, 3]

...

   outputs: $image_raw_type

Something like that

f0rodo avatar Aug 11 '21 18:08 f0rodo