A configuration parse error names the line before the one at fault
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 92/100
Direzione di ricerca
Leggi ploop in pybnf/parse.py, soprattutto i messaggi di errore e di log alle righe 1377 e 1383. Aggiungi test per una chiave sconosciuta e un valore formattato male che verifichino che la riga indicata corrisponda alla riga della chiave. L’issue è risolta quando entrambi i messaggi indicano il numero di riga corretto, a partire da uno.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 26
- Fork
- 25
- Merge medio
- 4h 9m
- PR unite (30g)
- 11
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di lanl/PyBNF
-
A local run never closes its LocalCluster, so in-process main() runs leave dask workers aliveAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
lanl/PyBNF#1063 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
lanl/PyBNF#1049 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
bug tech debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
bug minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
nael5x/creative-ai#130 ·
-
Make the "%" unit spacing the same in the web and in A10Forse già presa @kragent66-glitch l’ha presa oggi. Apertabug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
maiychrus25/OpenTea-DX-OS#226 · 1 commento ·
-
ci severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
TMHSDigital/Spackle#205 ·
I maintainer di solito rispondono entro 1 giorno
-
pkg:lgm type:chore upstream-gaussx
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
jejjohnson/pyrox#610 ·
I maintainer di solito rispondono entro 1 giorno