refactor(csr): use pandas/xarray-style verbs for CSRLinearExpression and Grid methods
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
- 38/100
Direzione di ricerca
Start with linopy/csr.py and inspect the methods on CSRLinearExpression and Grid, then trace their callers and existing tests. The issue leaves naming choices open, especially for with_const and the boundary with the public LinearExpression API. Done means an agreed naming scheme is applied consistently, with behavior unchanged and relevant tests passing.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
[!NOTE]
The following content was generated by AI.
Describe the feature you'd like to see
linopy/csr.py names the methods of CSRLinearExpression and Grid as past participles (summed, renamed, reindexed, ...). They return a new frozen object, never mutate. pandas and xarray use plain verbs for the same copy-returning operations (df.rename, da.reindex, fillna, ...), so the CSR layer diverges from the convention of the ecosystem linopy builds on.
Proposal: rename them to pandas/xarray-style verbs. Pure refactor, no behavior change.
| current | proposed |
|---|---|
CSRLinearExpression.summed(dims) |
sum(dims) |
aggregated(grid, rows) |
aggregate(grid, rows) |
renamed(names) |
rename(names) |
reindexed(grid, fill) |
reindex(grid, fill) |
filled(value) |
fillna(value) |
taken(rows, grid) |
take(rows, grid) |
added(other) |
add(other) |
scaled(factor) |
mul(factor) |
contracted(...) |
dot(...) |
pruned() |
prune() |
with_const(const) |
assign_const(const) (or keep) |
Grid.renamed / reordered / conformed / combined |
rename / transpose / conform / combine |
# today
expr._csr.aggregated(grid, rows).filled(0.0)
expr._csr.scaled(-1.0)
# proposed
expr._csr.aggregate(grid, rows).fillna(0.0)
expr._csr.mul(-1.0)
Trade-off to decide: LinearExpression already exposes the xarray verbs publicly. After the rename, expr.sum() and expr._csr.sum() share a name but differ in signature and semantics (e.g. the CSR sum takes a grid-level dim list and keeps explicit zero coefficients). The current participles keep the internal sparse layer visibly separate from the public dense API. The _csr attribute and the CSRLinearExpression type arguably mark that boundary well enough on their own.
- Lingua principale
- Python
- Stelle
- 260
- Fork
- 89
- Merge medio
- 1g 7h
- PR unite (30g)
- 25
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/linopy
-
bug solver interface
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
refactor sparse
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
Meta: separate dense and sparse stores from the expression and constraint frontendForse di nuovo libera @Rishabhkanhaiya l’ha presa 10 giorni fa e non c’è nessuna pull request aperta. Apertadiscussion refactor sparse
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
PyPSA/linopy#1019 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Xpress missing _license_probe: licensed_solvers includes xpress with an out-of-date licence, breaking local testsForse già presa @FabianHofmann l’ha presa 19 giorni fa. Apertabug solver interface
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
I maintainer di solito rispondono entro 1 giorno
-
discussion math-spec
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
PyPSA/linopy#993 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di PyPSA/linopy
Issue simili
-
`lvm_compact` has no self-hosted twin, and `docs/158` §5 says every language-face component mustApertabug sev-3 vm
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
sierra-research/tau2-bench#635 ·
I maintainer di solito rispondono entro 1 giorno
-
The add-ssm-model skill requires a Cython simulator; the contributing guide allows Python onesForse già presa @fmuia l’ha presa oggi. Apertadocumentation skill
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
lnccbrown/ssm-simulators#406 ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
btclib-org/btclib-ecc#309 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
autowarefoundation/autoware_carla_scenario#281 ·
I maintainer di solito rispondono entro 1 giorno