The typing of generate() is not very convenient as usually a formula produce either a Sample or a Sample3Phase but not both.
@shsms suggested to have generate and generate_3_phase, and different formulas implement different functions.
Originally posted by @shsms in #1037 (comment)