moscot icon indicating copy to clipboard operation
moscot copied to clipboard

prepare method does not warn about unknown parameters

Open Marius1311 opened this issue 1 year ago • 3 comments

I was just wondering why problem.prepare recomputes a PCA, even though I pre-computed one and passed join_attr='X_pca' until I realized that I had a typo in there. The prepare method does not complain about this, which can lead to unexpected behaviour.

Marius1311 avatar Aug 18 '23 20:08 Marius1311

Hi Marius,

Thanks for opening this issue.

I think we should discuss whether we want to throw an error for unrecognized arguments. We do this in the solve methods, as we can follow a clear logic there, i.e. testing whether an argument is an attribute of the solver class.

In prepare we don't have a logic like this, so we'd have to hard code the arguments we check for.

@michalk8 , do you have an opinion on this?

MUCDK avatar Aug 25 '23 12:08 MUCDK

we discussed this extensively in the past and I still think it's a pretty bad and unique ux design, wrong arguments should always errors, I understand that we had other priorities but it's something we'll have to figure out sooner than later

giovp avatar Aug 25 '23 15:08 giovp

Thanks for your reply @MUCDK - I fully agree with @giovp, not throwing error for unrecognised arguments can get really confusing.

Marius1311 avatar Aug 28 '23 11:08 Marius1311

closed with https://github.com/theislab/moscot/pull/696

selmanozleyen avatar Jul 03 '24 19:07 selmanozleyen

amazing, this is great! I think this was very important and will prevent many future mistakes in practical applications.

Marius1311 avatar Jul 04 '24 12:07 Marius1311