global calls
calls = 0
def ga_main(i):
global calls
calls = i
list = gplearn.fit(params)
return list
def fit():
global calls
result = parallel(params)
return result
parallel function contains the following class
class fitness():
def pearson_3D(params):
global calls
….
return result_2
#but calls in the last function can’t be recognized
#NameError: name ‘calls’ is not defined
#i try to add global calls to the class and function but it makes no sense
New contributor
asabxkh74155916 iscdi3190 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.