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

verify_params_dictionary: vp_100/mstar check is inverted

Aperta
#43 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 verify_params_dictionary in eddy/rotationmap.py (around L1236), where the vp_100 and mstar branches are inverted, and check where default_parameters.yml fills in mstar=1.0 before that check runs. Done means that setting both keys raises the ValueError, a power-law request with vp_100 set and mstar None selects _vpow without error, and a default mstar no longer blocks the power-law path. Related issue #36 touches the same block.

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

Descrizione

Summary

The vp_100 / mstar check in verify_params_dictionary has its branches inverted.

# eddy/rotationmap.py, verify_params_dictionary, ~L1236
if params['vp_100'] is not None:
    if params['mstar'] is not None:
        params['vfunc'] = self._vpow
    else:
        raise ValueError("Cannot specify both `vp_100` and `mstar`.")
else:
    params['vfunc'] = self._vkep
  • Both vp_100 and mstar set: the power law is used silently. The error the message describes is never raised.
  • vp_100 set and mstar=None (a pure power-law request): this raises "Cannot specify both vp_100 and mstar", even though only one was specified.
  • vp_100 set, mstar left out: mstar defaults to 1.0 in default_parameters.yml, so this goes through the first branch and works. That is the only reason the power-law path appears to work. It also means the check can never tell an explicit mstar from the default.

Suggested fix

Swap the branches, and record whether mstar was supplied by the user before defaults are filled in, so that a power-law fit isn't rejected because of the default mstar=1.0. For example, check 'mstar' in params before the default-population loop, and raise only if both keys were given explicitly.

Related: #36 (same block; it never selects the pressure-corrected vfunc).

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.