aai-institute / aai-institute/pyDVL
Refactor `lc_solve_problem`
- Langage dominant
- Python
- Étoiles
- 146
- Forks
- 10
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Regarde la fonction `lc_solve_problem` dans `pydvl/valuation/methods/_solve_least_core_problems.py`. Examine les arguments de bas niveau comme `A_eq`, `b_eq`, `A_lb`, `b_lb` et envisage de les regrouper dans un objet simple. Identifie les sections qui mélangent les niveaux d’abstraction et encapsule-les dans des fonctions de bas niveau séparées. Consulte la discussion de PR #580 pour le contexte. Exécute les tests existants pour t’assurer que le refactoring ne casse pas la fonctionnalité.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Domaine
- backend-api-design
- Type d'issue
- Refactorisation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 55/100