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

Cerrado
#538 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Ya se ha fusionado un pull request relacionado.

  • #484 de @jtravs — fusionado

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
65/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
3
Forks
3
Merge medio
8 h 28 min
PR fusionados (30 d)
176

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de LupoLab/solprop

Todos los issues de LupoLab/solprop

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.