record = runner.run(__name__, params=params)
transform = MyTransform()
trecord = transform.apply(record)
f = FileIO()
f.write(trecord, "record.json")
should come this:
record = runner.run(__name__, params=params)
f = FileIO()
f.write(record, "record.json", *, transform=MyTransform())
Might also be useful to give a feature flag inverse=True designating whether to use an inverse transform or not. This imposes the view that serializing = forward, deserializing = inverse transform, but to me, that's the most natural way of thinking about it.
Bonus: Should the transform be keyword-only (leaning no), or the aforementioned inverse argument (leaning yes)?
Instead of this:
should come this:
Might also be useful to give a feature flag
inverse=True
designating whether to use an inverse transform or not. This imposes the view that serializing = forward, deserializing = inverse transform, but to me, that's the most natural way of thinking about it.Bonus: Should the transform be keyword-only (leaning no), or the aforementioned inverse argument (leaning yes)?