get_velocity_profile() and annulus.get_vlos() with GP method fails at return
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 48/100
Research direction
Start in annulus.py at annulus.get_vlos() and get_vlos_GP(), especially the return-handling code around the reported line 479. Reproduce the failure with tutorial_4 or the shown get_vlos(fit_method='GP') call, then verify that the GP method returns successfully without the ambiguous-array error.
Written by the indexing model from the issue text.
Description
When running annulus.get_vlos(fit_method=''GP") returns this error. I got this error in tutorial_4 and with my own notebook trying to use get_velocity_profile().
100%|███████████████████████████████████████████████████████████████████████████████████████████| 1000/1000 [00:14<00:00, 69.43it/s]
ValueError Traceback (most recent call last)
Cell In[26], line 1
----> 1 print('v_phi = {:.0f} +- {:.0f} m/s'.format(*np.squeeze(annulus.get_vlos(fit_method='GP'))))
File ~/opt/anaconda3/envs/py310/lib/python3.10/site-packages/eddy/annulus.py:236, in annulus.get_vlos(self, p0, fit_method, fit_vrad, fix_vlsr, vrot_mask, vlsr_mask, vrad_mask, dv_mask, resample, optimize, nwalkers, nburnin, nsteps, scatter, signal, optimize_kwargs, mcmc, mcmc_kwargs, centroid_method, repeat_with_mask)
234 if fit_method == 'gp':
235 resample = False if resample is None else resample
--> 236 popt = self.get_vlos_GP(p0=p0,
237 fit_vrad=fit_vrad,
238 vlsr_mask=vlsr_mask,
239 dv_mask=dv_mask,
240 nwalkers=nwalkers,
241 nsteps=nsteps,
242 nburnin=nburnin,
243 scatter=scatter,
244 plots='none',
245 returns='percentiles',
246 resample=resample,
247 mcmc=mcmc,
248 optimize_kwargs=optimize_kwargs,
249 mcmc_kwargs=mcmc_kwargs)
251 cvar = 0.5 * (popt[:, 2] - popt[:, 0])
252 popt = np.array([popt[0, 1],
253 popt[1, 1] if fit_vrad else np.nan,
254 np.nan])
File ~/opt/anaconda3/envs/py310/lib/python3.10/site-packages/eddy/annulus.py:479, in annulus.get_vlos_GP(self, p0, fit_vrad, vlsr_mask, dv_mask, optimize, nwalkers, nburnin, nsteps, scatter, niter, plots, returns, resample, mcmc, optimize_kwargs, mcmc_kwargs)
477 idx = returns.index('percentiles')
478 returns[idx] = np.percentile(samples, [16, 50, 84], axis=0).T
--> 479 if 'samples' in returns:
480 idx = returns.index('samples')
481 returns[idx] = samples
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
- Dominant language
- Python
- Stars
- 23
- Forks
- 10
- Avg merge
- 28m
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PlanetFormationLab/eddy
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
PlanetFormationLab/eddy#36 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 78/100
PlanetFormationLab/eddy#39 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
PlanetFormationLab/eddy#35 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
PlanetFormationLab/eddy#34 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
PlanetFormationLab/eddy#33 · 2 comments ·
All issues in PlanetFormationLab/eddy
Similar issues
-
essnmx good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
[Feature] 奇物选择添加优先级 Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Giskard-AI/giskard-oss#2840 · 1 comment ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Openarea: repo bug perceived difficulty: 2
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
yeti-platform/yeti#1380 ·