GADMA icon indicating copy to clipboard operation
GADMA copied to clipboard

Automatically check for args option when gadma.optimize_ga is using

Open noscode opened this issue 1 year ago • 0 comments

Sometimes gadma.optimize_ga is using the following way:

popt = gadma.Inference.optimize_ga(
                                   data,
                                   func_ex,
                                   engine='dadi',
                                   args=pts,
                                   p_ids = p_ids,
                                   X_init= [p0],
                                   lower_bound=lower_bound,
                                   upper_bound=upper_bound,
                                   verbose=1)

In that case there is an error: UserWarning: Error occurred during caching: evaluate() takes 3 positional arguments but 5 were given.

The correct way of usage is: args=(pts,),. It would be great to add an extra check when args are misspecified.

noscode avatar Mar 25 '24 16:03 noscode