[FEATURE] Replace the stdin/stdout JSON hand-off between Python and Julia OPF with file-based exchange
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Start with pm_optimize and Main.jl, where the issue says Python writes input to Julia’s stdin and Julia emits results on stdout; trace how arguments and the existing results directory are handled. Check the subprocess and result conversion paths, then run the relevant optimization tests. Done means input and result are exchanged through files and stdout carries logs only, with results still loaded into the eDisGo object.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Current state
pm_optimize writes the network as one JSON line to the Julia subprocess's stdin; Main.jl
prints the result JSON to stdout, interleaved with debug logs, printlns and Gurobi
banners. Python identifies the result line by out.rstrip().startswith('{"name"').
Why this is fragile
- Result detection depends on unguaranteed JSON key order.
JSON.json(::Dict)serializes
in hash/iteration order —"name"being the first key is coincidence, not contract. If the
result line ever starts with another key (different Julia/JSON.jl version, changed key set),
thestartswithbranch misses it:from_powermodelsis never called, no results are
written to the eDisGo object, the raw JSON is echoed to stdout, and the run still logs
"Julia process was successful." — silent loss of results on a successful solve. - Logs and payload share one channel, separated only by prefix heuristics (
"Set parameter",
"Academic"). - The input contract ("exactly one JSON line on stdin", read via
readline) is implicit and
unenforced; large inputs are written in full before stdout is drained (OS pipe-buffer
deadlock risk for very large networks).
Proposal
Exchange input and result as files (paths passed as arguments, e.g. into the existing
results directory or a temp dir): Python writes <run>_input.json, Julia writes
<run>_result.json; stdout remains purely a log channel. This removes the key-order trap, the
log/payload mixing and the pipe-buffer risk in one step.
Interim hardening (if stdout must stay temporarily): wrap the result in an unambiguous sentinel
(e.g. ###RESULT###{…}) instead of keying on {"name".
- Lingua principale
- Python
- Stelle
- 48
- Fork
- 22
- Merge medio
- 1g 8h
- PR unite (30g)
- 37
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna 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 openego/eDisGo
-
area: database bug priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug correctness priority: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno
-
[BUG] Spatial complexity reduction merges MV and LV buses when an LV grid has the ID of the MV gridApertabug correctness priority: high
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
bug correctness priority: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
OPF docs: explain where the curtailment request comes from and how versions 3 and 4 handle itApertaarea: opf documentation priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di openego/eDisGo
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
pylint-dev/pylint#11791 ·
I maintainer di solito rispondono entro 1 giorno
-
Rasterio granule reads never retry, so one 503 (Service Unavailable) fails the whole requestForse già presa @chuckwondo l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
developmentseed/titiler-cmr#305 ·
I maintainer di solito rispondono entro 1 giorno
-
community enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno