Allow overwriting tags by rewriting the mechanism to use inheritance#14635
Allow overwriting tags by rewriting the mechanism to use inheritance#14635amueller wants to merge 4 commits intoscikit-learn:masterfrom
Conversation
|
So the problem this solves is basically that it's currently hard to know what changing |
|
@jnothman The explanation by @NicolasHug is pretty on point. Previously we didn't allow overwriting tags in the hierarchy, or rather we allowed changing them exactly once. Which is not flexible enough for many cases. @NicolasHug as mentioned, it might be possible to do without it. I'll send a different PR that will probably work by changing the inheritance order instead of introducing a base class. |
|
closing for now, I prefer #14644 |
Fixes #14044.
This should work but might be considered slightly hacky.
It avoids reordering mixins and base estimator by creating a common base class.
I would argue it would be nicer to not use mixins and use inheritance instead and make the mixins ABCs.
This is semi-backward-incompatible for third-party authors. If they had a hierarchy of classes that added (different) tags in each class using
_more_tags, this will now break as_more_tagsis only called onselfand not on the full MRO.If they only have one class which defines
_more_tagsI think this should work.This rewrite basically gets rid of
_more_tagswhich could be deprecated.