A malformed noise_model line is reported as "noise_model is not a valid configuration key", and every config parse error reports the line before the right one
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
Direzione di ricerca
Inizia da pybnf/parse.py: esamina il ciclo di parsing della configurazione intorno alla riga 876 e i rami degli hint di formato intorno alla riga 1359, poi cerca test del parser che coprano valori di configurazione malformati. Riproduci il problema con examples/tutorial/36_estimate_noise/estimated_sigma.conf usando la riga noise_model malformata dell’issue. Il lavoro è completato quando gli errori identificano la riga corretta, numerata a partire da 1, distinguono le chiavi sconosciute dai valori non validi per chiavi note e i test coprono questi casi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Writing a fixed noise level as a bare number is an easy mistake:
noise_model = normal, sigma = 4
The correct form is sigma = fix_at 4. PyBNF reports the mistake as
Error: Parsing configuration key 'noise_model' on line 42.
noise_model is not a valid configuration key.
Both parts of the message are wrong.
-
noise_modelis a valid key. The value is what failed to parse. Inpybnf/parse.py, after a line fails the grammar, a chain ofelif key == ...branches picks a format hint for the key. A key with no branch falls through tofmt == ''and gets "is not a valid configuration key". The comment on thedatabranch (around line 1359) describes this same problem fordataand fixes it for that one key only.noise_modelhas no branch, and neither does any other real key not in the chain. -
The line number is off by one. With the reproduction below, the
noise_modelline is line 43 of the file (grep -nagrees), and the message says 42. The number is the indexifromfor i, line in enumerate(ls)(around line 876), which counts from 0. Every message built from it, including theMisconfigured config key ... at line: {i}text, points at the line before the one at fault.
Reproduction: in examples/tutorial/36_estimate_noise/estimated_sigma.conf, replace the noise_model line with noise_model = normal, sigma = 4, delete the loguniform_var = noise_level ... line, and run pybnf -c on it.
Suggested fix: report a line number counted from 1. When the key is a real configuration key but its value does not parse, say so and give the accepted forms, as the data branch does. Use "is not a valid configuration key" only for a key PyBNF does not know. A test that runs every known key with a malformed value through the parser would keep the next new key from falling through.
- Lingua principale
- Python
- Stelle
- 25
- Fork
- 25
- Merge medio
- 4h 5m
- PR unite (30g)
- 10
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
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
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
-
bug silent-incorrectness
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
software-mansion-labs/Diplomat#20 ·
I maintainer di solito rispondono entro 1 giorno
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaForse già presa @lijy91 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
libnativeapi/nativeapi#53 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
View Counts discarded due to field name mismatchForse già presa @rsiva0400 l’ha presa oggi. Apertasite-bug triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Model version publishes the new UK firm entity as a personForse già presa @vahid-ahmadi l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
PolicyEngine/policyengine.py#764 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
spcl/HPCAgent-Bench#264 ·
I maintainer di solito rispondono entro 1 giorno