refactor(csr): use pandas/xarray-style verbs for CSRLinearExpression and Grid methods
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
[!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.
- 主要言語
- Python
- スター
- 260
- フォーク
- 89
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 24
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PyPSA/linopy のほかの issue
-
bug solver interface
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
CSR constraints: support `update()` instead of raising frozen errors対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンenhancement sparse
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
refactor sparse
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
Meta: separate dense and sparse stores from the expression and constraint frontend対応中かも @Rishabhkanhaiya が 12 日前に担当しました。 オープンdiscussion refactor sparse
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
PyPSA/linopy#1019 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Xpress missing _license_probe: licensed_solvers includes xpress with an out-of-date licence, breaking local tests対応中かも @FabianHofmann が 21 日前に担当しました。 オープンbug solver interface
難易度 4/5 3〜5日 初心者へのやさしさ 58/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
`image_generation`: `max_retries` is ignored for OpenAI-compatible providers (always 2 retries)対応中かも @ericz7900 が今日担当しました。 オープンllm translation
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
rheeloaded/paperpull#117 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
agenda-tech-brasil/agenda-tech-brasil#1619 · コメント 1 件 ·
-
process
難易度 1/5 1〜3時間 初心者へのやさしさ 76/100
pyrite-wiki/pyrite#1036 ·
メンテナーはふだん 1 日以内に返信