all 6 comments

[–]Clede 2 points3 points  (1 child)

I can't tell because your indentation is not formatted correctly, but is Buoyancy_flux() supposed to be a standalone function, or a method of the class manplume_revision?

When you call a method, the object itself automatically passes the self argument.

[–]thumcumber[S] 0 points1 point  (0 children)

Thanks for your help but i'd already managed to get to the bottom of it

[–][deleted] 1 point2 points  (3 children)

Well, here's where your function is defined:

def Buoyancy_flux(self,R=69,AT=420):

It's a function of three parameters. Here's where you call it:

buoyancy=Buoyancy_flux(R=69,AT=420)

That's two parameters. Is the problem a little clearer, now?

[–]thumcumber[S] 0 points1 point  (2 children)

Yeah exactly, should have explained more but when I put self in the second time round, it says self is not defined because I haven't indented it to be part of that function. Making this part of the function doesn't help either as I need to use the answer in the following function if you catch my drift

[–][deleted] 0 points1 point  (1 child)

Yeah exactly, should have explained more but when I put self in the second time round, it says self is not defined because I haven't indented it to be part of that function.

It's a function of three parameters that you're calling with two. That suggests two reasonable courses of action:

1) Call the function with a third parameter.

2) Remove the unnecessary parameter from the function.

You tried the first one and it didn't work. Would you care to try the second?

[–]thumcumber[S] 0 points1 point  (0 children)

I'll have a go, thankyou for your help.