Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

fit_map: unknown/misspelled keys in params are silently ignored (e.g. m_disk vs mdisk)

Aperta
#42 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
62/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
data

Direzione di ricerca

Start in eddy/rotationmap.py at verify_params_dictionary (around line 1231), where the loop over default_parameters pops known keys and leaves everything else in params untouched. Reproduce with a misspelled key such as m_disk in a fit_map call and confirm that no warning is raised. Done when unknown keys produce a warning or error, internal flags like vfunc and vortex still pass, and a close-match hint such as mdisk appears where practical. Settle warn-versus-raise with the maintainer first.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

verify_params_dictionary fills in defaults for the keys listed in default_parameters.yml and silently keeps any other key in params. A misspelled parameter name is therefore ignored rather than flagged. If that key is also mapped to a p0 index, the sampler walks a dimension the likelihood never sees.

Example

Writing m_disk where eddy expects mdisk:

params['r_in'] = 4
params['r_out'] = 4.0
params['m_disk'] = 5     # typo: should be 'mdisk'
params['gamma'] = 6
p0 += [1.0, 0.0, 1.0]
samples = cube.fit_map(p0=p0, params=params, ...)
  • mdisk gets its default (None), so _calc_mdisk returns 0 and the model is purely Keplerian.
  • m_disk takes slot 5 of p0 but never reaches the model, so it random-walks inside the walker spread. r_in and gamma are also unconstrained, because they are only used in _calc_mdisk.
  • The only output is the Assuming: p0 = [x0, y0, mstar, vlsr, r_in, m_disk, gamma] echo, which reads as if the fit is correct. The optimizer returns these three parameters unchanged from their starting values.

Nothing errors, and the fitted map looks plausible.

Where

eddy/rotationmap.py, verify_params_dictionary (~L1231):

for p in self.default_parameters.keys():
    params[p] = params.pop(p, self.default_parameters[p]['default'])

Suggested fix

After populating the defaults, warn (or raise) on any key that is not in default_parameters and is not an internal flag (vfunc, vortex, beam, ...). Raising is probably right whenever an unknown key is mapped to a p0 index, since that dimension can never be constrained. A difflib close-match suggestion ("did you mean mdisk?") would make the message more useful.

Lingua principale
Python
Stelle
23
Fork
11
Merge medio
28m
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PlanetFormationLab/eddy

Tutte le issue di PlanetFormationLab/eddy

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.