lpf() and pf() fail on stochastic networks
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
- 42/100
Direzione di ricerca
Start with pypsa/network/graph.py:294 and the inds handling in pypsa/network/power_flow.py:106 and :1855; the report links the latter to #1977. Run the supplied reproducible example on the current master branch and check how lpf() and pf() handle scenario-indexed buses and components. Done means both run per scenario, or fail fast with a clear NotImplementedError stating stochastic networks are unsupported.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
[!NOTE]
This issue was drafted with AI assistance.
Version Checks (indicate both or one)
- I have confirmed this bug exists on the lastest release of PyPSA.
- I have confirmed this bug exists on the current
masterbranch of PyPSA.
Issue Description
n.lpf() and n.pf() fail on stochastic networks (after n.set_scenarios(...)). The error comes from incidence_matrix in pypsa/network/graph.py:294, where the bus lookup gives -1 for (scenario, name) indexed buses, and scipy rejects the negative index.
Related: pypsa/network/power_flow.py:106 and :1855 pass c.static.query("active").index as inds to get_switchable_as_dense. On a stochastic network this is a (scenario, name) MultiIndex, but inds is matched on the name level only, so the result is silently empty (see #1977).
Reproducible Example
import pypsa
n = pypsa.Network()
n.set_snapshots(range(2))
n.add("Bus", ["a", "b"], v_nom=380)
n.add("Line", "l", bus0="a", bus1="b", x=0.1, r=0.01, s_nom=100)
n.add("Generator", "g", bus="a", p_set=50, control="Slack")
n.add("Load", "d", bus="b", p_set=50)
n.set_scenarios(["s1", "s2"])
n.lpf() # ValueError: negative axis 0 index: -1
n.pf() # ValueError: negative axis 1 index: -1
Expected Behavior
Power flow runs per scenario, or fails fast with a clear NotImplementedError saying that power flow does not support stochastic networks.
Installed Versions
- PyPSA master d371a505
- Lingua principale
- Python
- Stelle
- 2.2k
- Fork
- 712
- Merge medio
- 1g 13h
- PR unite (30g)
- 34
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un 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 PyPSA/PyPSA
-
Ramp limits of a fixed modular committable unit scale with p_nom times the number of running modulesApertaoperational realism optimization
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
breaking components API data validation high priority needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
PyPSA/PyPSA#1977 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Docs list e_sum_min/e_sum_max constraints for Links and Processes, which do not existForse già presa @FabianHofmann l’ha presa 2 giorni fa. Apertadocumentation optimization
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
PyPSA/PyPSA#1976 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
n.add of a single component spends half its time on default-column inserts and the unknown-bus isinForse già presa @MaykThewessen l’ha presa oggi. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
PyPSA/PyPSA#2001 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
needs triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 54/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à 2/5 1-3 ore Idoneità per principianti 76/100
rpm-software-management/mock#1824 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
jpata/particleflow#520 ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue hacktoberfest
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
gridhead/gi-loadouts#699 ·
I maintainer di solito rispondono entro 13 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
FinanceFlash/unvibecode#206 ·
I maintainer di solito rispondono entro 1 giorno