lambda_rdw_all raises a bare ValueError on an antiresonant fibre's default range

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

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Read tools.lambda_rdw_all and _zdw_near, which the issue cites as related behavior. Reproduce the failure with the antiresonant_fibre example and inspect how non-finite samples are handled while bracketing roots. Done when the default range either skips those samples or raises a solprop error that identifies the range, and the reported case no longer produces a bare SciPy ValueError.

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

Descrizione

priority: low

What happens

tools.lambda_rdw_all on a VincettiMode raises a bare ValueError from scipy.optimize.brentq with its default search range:

from solprop.recipe import Recipe
from solprop import tools

recipe = Recipe.example("antiresonant_fibre")
k = recipe.keywords()
mode = recipe.build().modes[0]
p = tools.soliton_params(mode, k["gas"], k["pressure"], energy=k["energy"], fwhm=k["fwhm"],
                         wavelength=k["wavelength"], shape="gauss")
tools.lambda_rdw_all(mode, k["wavelength"], peak_power=p.peak_power, gamma=p.gamma,
                     fwhm=p.fwhm, shape=p.shape)
# ValueError: The function value at x=1.7659346048877808e+16 is NaN; solver cannot continue.

The mismatch is NaN near 107 nm, inside the default range. Passing wavelength_limits=(300e-9, 720e-9) avoids it and returns ().

Expected

A range that holds non-finite values either skips them or raises solprop's own error naming the range, as _zdw_near does by treating a non-finite sample as unable to bracket anything.

Why it matters

The front end works around it by searching only within the run's own wavelength window. summarise swallows the ValueError and reports it as a design error.

Lingua principale
Python
Stelle
3
Fork
3
Merge medio
6h 51m
PR unite (30g)
136

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 LupoLab/solprop

Tutte le issue di LupoLab/solprop

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.