Im trying to create a function that takes 6 arguments, 3 of which are "optional" given that I tried giving them default values. This function takes in the 6 values and gives them to another function (defined previously).
Every time I try to run it I get a TypeError: Coeff() got an unexpected keyword argument 'h'. I was hoping someone could help me with this!
def TSR_inf(coeff, maxmin, d, h='houle', t_h=0, Per=0):
coeff = coeff
maxmin = maxmin
d=d
h = h
t_h = t_h
Per = Per
Coeff(coeff, maxmin, d, h='houle', t_h=0, Per=0)
The Coeff() function is defined as such:
def Coeff(coeff, maxmin, d, h='houle', t_h=0, Per=0):
if coeff == 'wave' and maxmin == 'max' and d == 'x' and t_h == 0 and Per == 0 and h == 'houle':
Wave_max('x')
elif coeff == 'wave' and maxmin == 'max' and d == 'x' and t_h == 0 and Per == 0 and h == 'no houle':
Wave_max('x', 'no houle')
elif coeff == 'wave' and maxmin == 'max' and d == 'x' and t_h == 'reg' and Per == 0 and h == 'houle':
Wave_max('x', 'reg')
elif coeff == 'wave' and maxmin == 'max' and d == 'x' and t_h == 'reg' and Per == 1 and h == 'houle':
Wave_max('x', 'reg', 1)
elif coeff == 'wave' and maxmin == 'max' and d == 'x' and t_h == 'reg' and Per == 1.5 and h == 'houle':
Wave_max('x', 'reg', 1.5)
elif coeff == 'wave' and maxmin == 'max' and d == 'x' and t_h == 'reg' and Per == 2 and h == 'houle':
Wave_max('x', 'reg', 2)
elif coeff == 'wave' and maxmin == 'max' and d == 'x' and t_h == 'irreg' and Per == 0 and h == 'houle':
Wave_max('x', 'reg')
elif coeff == 'wave' and maxmin == 'max' and d == 'x' and t_h == 'irreg' and Per == 1 and h == 'houle':
Wave_max('x', 'reg', 1)
elif coeff == 'wave' and maxmin == 'max' and d == 'x' and t_h == 'irreg' and Per == 1.5 and h == 'houle':
Wave_max('x', 'reg', 1.5)
elif coeff == 'wave' and maxmin == 'max' and d == 'x' and t_h == 'irreg' and Per == 2 and h == 'houle':
Wave_max('x', 'reg', 2)
This Coeff() function calls another function def Wave_max(d, h, t_h, Per): that I won't post here because it is irrelevant (but if you do want it let me know and I'll add it later).
If anyone can spot where I made the mistake that leads to the TypeError I won't be veery much appreciated!!
Cheers all! (and thank you in advance!)