kalekundert / stepwise

Modular, command-line scientific protocols
GNU General Public License v3.0
3 stars 0 forks source link

Easy way to produce pickles from python protocols #33

Closed kalekundert closed 3 years ago

kalekundert commented 3 years ago

Currently, protocols written in python end with print(protocol). This converts the protocol to a string, losing any potentially smart features of the steps. A better approach would be to provide something like protocol.print() that would output the protocol to a pickle if stdout isn't attached to a TTY. The implementation would be very simple:

class Protocol:
    ...
    def print(self):
        io = ProtocolIo(self)
        io.to_stdout()