aai-institute / aai-institute/pyDVL
Refactor `lc_solve_problem`
- 主要言語
- Python
- スター
- 146
- フォーク
- 10
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
We should refactor `pydvl.valuation.methods._solve_least_core_problems.lc_solve_problem`
In the discussion of PR #580, @schroedk wrote:
> This function is mixing two levels of abstraction, on the one hand it is doing a lot of low level stuff to construct the conditions for the optimization problem and on the other hand, it calls other more low-level functions (solve...). This mixing of levels of abstractions makes it harder to read. Even if a user would not call this function directly, for the developers it is a more difficult task to grasp what is happening (actually the comment helps a lot and in combination with the log messages it seems to me that the related code should be encapsulated in other low-level functions with only one purpose).
Another problem is that all low level functions that are called inside `lc_solve_problem` have many similar argument (e.g. `A_eq`, `b_eq`, `A_lb`, `b_lb`). We should bundle those arguments in a simple Object. That way we can pass them around more easily and do some simple compatibility checks during initialization.
コントリビューションガイド
調査の方向性
`pydvl/valuation/methods/_solve_least_core_problems.py` の関数 `lc_solve_problem` を見てください。`A_eq`, `b_eq`, `A_lb`, `b_lb` のような low-level 引数を調べ、それらを単純なオブジェクトにまとめることを検討してください。抽象化レベルが混在しているセクションを特定し、それらを個別の low-level 関数にカプセル化してください。コンテキストとして PR #580 の議論を確認してください。既存のテストを実行して、リファクタリングが機能を壊さないことを確認してください。
索引モデルが issue の本文から書いたものです。
評価
- 領域
- backend-api-design
- issue の種類
- リファクタリング
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 55/100