superduper
superduper copied to clipboard
[FLATTEN-ENCODING] Make encoding of `Document` less nested and easier to write
As a user specifying a Stack
or Component
using the Document
formalism, I don't want deep nesting, rather shallow nesting, so that it's possible to easily write these specifications in yaml
without too much trouble and mental gymnastics.
Specification:
_leaves
- identifier: 123231ae1f212567896343444
cls: Artifact
module: superduperdb.components.datatype
dict:
datatype: pil_image
x: $_leaves[-1]
This would give a decoding as a Document.unpack()
of {'x': <PIL.Image.PNGImagePlugin 1234x3>}
.
This can be applied to all objects which require encoding.