Solved by albanD in post #2 
              
              
                Hi, 
data_gen.parameters() returns a generator. So you most likely want to do something like: list(dat_gen.paramters()) + [Z,]