`runner.sh` Parses Some Files Incorrectly
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 30/100
Direzione di ricerca
Inizia ispezionando runner.sh e il relativo percorso di estrazione con jupytext e sed, quindi confronta il comportamento descritto in PR #1794. Il lavoro è completato quando lo script preserva Python ben formato durante l’estrazione del contenuto per pep8 senza introdurre errori di sintassi, incluso l’esempio multilinea mostrato qui.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
The runner.sh script parses out the output from jupytext into something for feeding into pep8. sed is used in places to pick parts out, however for some weirdly formatting Python this will introduce syntax errors. For example, the following will not be interpreted correctly:
if epoch % 10 == 0:
print(
"Train: reconstruction: %.4f; generator: %.4f; discriminator: %.4f; perceptual: %.4f; kld: %.4f"
% (
epoch_recon_losses[-1],
epoch_gen_losses[-1],
epoch_disc_losses[-1],
epoch_perc_losses[-1],
epoch_kld_losses[-1],
)
)
The solution is to reformulate the code to avoid these sorts of issues. This example here isn't very attractive code anyway so a refactor to break the contents into multiple lines which are read properly wouldn't hurt anyhow. There will be other cases potentially that are well-formed code but still introduce parsing issues.
This is a minor issue I haven't had time to work on a solution for other than to refactor code, a solution to using jupytext and sed better should be investigated later.
To Reproduce
This can be seen as a problem in PR #1794 currently though a fix is being worked on.
Expected behavior
Script shouldn't introduce issues
- Lingua principale
- Jupyter Notebook
- Stelle
- 2.5k
- Fork
- 803
- Merge medio
- 6g 22h
- PR unite (30g)
- 3
Guida per i contributori
Apri 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 Project-MONAI/tutorials
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
Project-MONAI/tutorials#2076 · 2 commenti ·
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 76/100
Project-MONAI/tutorials#2069 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
Project-MONAI/tutorials#1704 ·
-
Rehost CONSep Aperta
Project-MONAI/tutorials#2079 · 2 assegnatari ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 62/100
Project-MONAI/tutorials#2071 ·
Tutte le issue di Project-MONAI/tutorials
Issue simili
-
area: harness bug status: needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Human-Agent-Society/reef#625 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
vercel-labs/just-bash#464 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100