A configuration parse error names the line before the one at fault
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 92/100
Línea de trabajo
Lee ploop en pybnf/parse.py, especialmente los mensajes de error y de registro en las líneas 1377 y 1383. Añade pruebas para una clave desconocida y un valor con formato incorrecto que verifiquen que la línea indicada coincide con la línea de la clave. El issue está resuelto cuando ambos mensajes indican el número de línea correcto, empezando por uno.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
When PyBNF cannot parse a line of a configuration file, the error names the line before the one at fault.
To reproduce, save this as probe.conf and run pybnf -c probe.conf -o:
edition = 2
model = nope.bngl : nope.exp
job_type = fit
output_dir = out
max_iterations = many
PyBNF 1.8.2 (main at 292774b0) prints:
Error: Parsing configuration key 'max_iterations' on line 4.
max_iterations should be specified in the format 'max_iterations=x' where x is an integer
max_iterations is on line 5. An unknown key is reported the same way. A file with job_typ = fit on line 6 is reported as line 5. Comments and blank lines do not change the offset.
The cause is in ploop in pybnf/parse.py. It numbers the lines with enumerate(ls), which counts from 0. The error message at line 1377 and the log message at line 1383 print that index as it is. The fix is to print i + 1 in both, with a test that checks the reported line against the line the key is on, for an unknown key and for a badly formatted value.
The other errors that give a line number already count from 1. These are the constraint file parser in pybnf/constraint.py and the BNGL action check in pybnf/pset.py. No test pins the current number.
Found while drafting #1054.
- Lenguaje dominante
- Python
- Estrellas
- 26
- Forks
- 25
- Merge medio
- 4 h 9 min
- PR fusionados (30 d)
- 11
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de lanl/PyBNF
-
A local run never closes its LocalCluster, so in-process main() runs leave dask workers aliveAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
lanl/PyBNF#1063 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
lanl/PyBNF#1049 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
bug tech debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
bug minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
Todos los issues de lanl/PyBNF
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
nael5x/creative-ai#130 ·
-
Make the "%" unit spacing the same in the web and in A10Posiblemente ocupada @kragent66-glitch la tomó hoy. Abiertobug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
maiychrus25/OpenTea-DX-OS#226 · 1 comentario ·
-
ci severity: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
TMHSDigital/Spackle#205 ·
Los mantenedores suelen responder en 1 día
-
pkg:lgm type:chore upstream-gaussx
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
jejjohnson/pyrox#610 ·
Los mantenedores suelen responder en 1 día