probnum icon indicating copy to clipboard operation
probnum copied to clipboard

Refactor the design of the probabilistic linear solver functions and classes

Open JonathanWenger opened this issue 4 years ago • 2 comments

  • [x] Cleanly separate _preprocess_linear_system from _init_solver ~and make sure only one takes the assumptions on A, i.e. assume_A as an argument.~

  • [ ] Create a common (abstract) class MatrixBasedSolver(ProbabilisticLinearSolver) with generic functions:

    • policy
    • observe
    • step_size / line_search
    • infer_posteriors
    • optim_hyperparams
    • solve
    • ... This way we can avoid some code duplication between the different versions of the matrix-based solvers.

JonathanWenger avatar Apr 21 '20 18:04 JonathanWenger

In the initial pylint PR #150 I found many pylint messages that mostly relate to linalg, and especially matrixbased. I'll post a full list in here since it seems to relate to this PR. If you think that those are better tackled through individual tasks I could also open individual issues:

  • too-many-arguments
  • abstract-method
  • too-many-branches
  • arguments-differ
  • redefined-builtin
  • too-many-lines
  • abstract-class-instantiated
  • too-complex
  • too-many-instance-attributes
  • too-many-statements
  • attribute-defined-outside-init

These are not all the errors that pylint raises, neither are those errors that only appear in linalg, but I think that most of these should be considered when working on this refactoring, and ideally I would hope for pylint src/probnum/linalg/ to pass with these messages enabled (e.g. through the --enable=<message> argument).

nathanaelbosch avatar Aug 18 '20 16:08 nathanaelbosch

Relating to my previous comment: I just opened #158 to track the work on the pylint exceptions for the linalg module.

nathanaelbosch avatar Aug 19 '20 08:08 nathanaelbosch