Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ce() missing 2 required positional arguments: 'Aell' and 'phi0' #849

Open
amiszuda opened this issue Apr 17, 2024 · 3 comments
Open

ce() missing 2 required positional arguments: 'Aell' and 'phi0' #849

amiszuda opened this issue Apr 17, 2024 · 3 comments

Comments

@amiszuda
Copy link

Hi,

I have noticed that sometimes EBAI fails with TypeError: ce() missing 2 required positional arguments: 'Aell' and 'phi0' error. The working example can be found in the attachment, and the full error log is provided below:

2G model C failed with error: Residuals are not finite in the initial point.
2G model CE failed with error: Residuals are not finite in the initial point.
2G model CG failed with error: Residuals are not finite in the initial point.
2G model CGE failed with error: Residuals are not finite in the initial point.
2G model CG12 failed with error: Residuals are not finite in the initial point.
2G model CG12E1 failed with error: Residuals are not finite in the initial point.
2G model CG12E2 failed with error: Residuals are not finite in the initial point.
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-390114a87a57> in <module>
      1 b.add_solver('estimator.ebai', solver='lc_est_ebai_mlp', ebai_method='mlp', overwrite=True)
----> 2 b.run_solver('lc_est_ebai_mlp', solution='lc_soln_ebai_mlp', overwrite=True)
      3 print(b.adopt_solution('lc_soln_ebai_mlp', overwrite=True, trial_run=True))

~/.local/lib/python3.6/site-packages/phoebe/parameters/parameters.py in _send_if_client(self, *args, **kwargs)
    422 
    423         else:
--> 424             return fctn(self, *args, **kwargs)
    425 
    426     return _send_if_client

~/.local/lib/python3.6/site-packages/phoebe/frontend/bundle.py in run_solver(self, solver, solution, detach, return_changes, **kwargs)
  13647 
  13648         solver_class = getattr(_solverbackends, '{}Backend'.format(solver_ps.kind.title()))
> 13649         params = solver_class().run(self, solver_ps.solver, compute, solution=solution, **{k:v for k,v in kwargs.items() if k not in ['compute']})
  13650         metawargs = {'context': 'solution',
  13651                      'solver': solver_ps.solver,

~/.local/lib/python3.6/site-packages/phoebe/solverbackends/solverbackends.py in run(self, b, solver, compute, **kwargs)
    553 
    554         else:
--> 555             rpacketlists_per_worker = [self.run_worker(**packet)]
    556 
    557         logger.debug("rank:{}/{} calling _fill_solution".format(mpi.myrank, mpi.nprocs))

~/.local/lib/python3.6/site-packages/phoebe/solverbackends/solverbackends.py in run_worker(self, b, solver, compute, **kwargs)
   1248             lcModel = ligeor.models.Polyfit(phases=phases_shifted[s], fluxes=fluxes[s], sigmas=sigmas[s])
   1249 
-> 1250         lcModel.fit()
   1251         ebai_phases = np.linspace(-0.5,0.5,ebai_phase_bins)
   1252         ebai_fluxes = lcModel.compute_model(ebai_phases, best_fit=True)

~/.local/lib/python3.6/site-packages/phoebe/dependencies/ligeor/models/twogaussian.py in fit(self, fit_funcs, param_vals)
    100             # compute all model light curves
    101 
--> 102         self.compute_twoGaussian_models()
    103         # compute corresponding BIC values
    104         self.compute_twoGaussian_models_BIC()

~/.local/lib/python3.6/site-packages/phoebe/dependencies/ligeor/models/twogaussian.py in compute_twoGaussian_models(self)
    619 
    620         for fkey in self.fits.keys():
--> 621             models[fkey] = self.twogfuncs[fkey](self.phases, *self.fits[fkey])
    622 
    623         self.models = models

TypeError: ce() missing 2 required positional arguments: 'Aell' and 'phi0'

failing_EBAI.tar.gz

@kecnry
Copy link
Member

kecnry commented Apr 17, 2024

Does the error go away if you disable phase-binning in the solver options? See also #829 and #743.

This seems to be happening more and more though, so we'll try to bump its priority up and try to fix it in an upcoming bugfix. (Changing the title just so that it is a little more discoverable since this does occur for other solvers as well).

@kecnry kecnry changed the title Failing EBAI ce() missing 2 required positional arguments: 'Aell' and 'phi0' Apr 17, 2024
@amiszuda
Copy link
Author

Disabling phase_bin does help, though I thought to emphasize this error knowing that it happened before and possibly has not been fully resolved. Thanks though!

@kecnry
Copy link
Member

kecnry commented Apr 17, 2024

Yep - still definitely needs to be fixed (or at least raising an error suggesting disabling phase-binning), so good to have this filed as an actual issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants