The main reason is all of the code is assume to rely on the presence of cls.apply when doing things such as inheriting the docstirng and generating the docstring for the validate function.
I'd also assumed it was needed for get_valid_options but I was smarter when coding that and it in fact uses the mro to find all of the apply methods in the hierarchy and skips over those that don't have one.
This is a flaw with the transformation_documentation_wrapper then - we could do better and only update apply if its on cls, and update validate according to the first apply method we find looping up the mro (similar to psyGen.py::2751-2754). I'm happy to fix this up soon if you'd like as I think it could be a relatively small task - if so can you open an issue and I'll also add a TODO to remove this apply method once that issue is resolved?
Originally posted by @LonelyCat124 in #3205 (comment)
The main reason is all of the code is assume to rely on the presence of
cls.applywhen doing things such as inheriting the docstirng and generating the docstring for the validate function.I'd also assumed it was needed for
get_valid_optionsbut I was smarter when coding that and it in fact uses the mro to find all of theapplymethods in the hierarchy and skips over those that don't have one.This is a flaw with the transformation_documentation_wrapper then - we could do better and only update
applyif its oncls, and update validate according to the first apply method we find looping up the mro (similar topsyGen.py::2751-2754). I'm happy to fix this up soon if you'd like as I think it could be a relatively small task - if so can you open an issue and I'll also add a TODO to remove this apply method once that issue is resolved?Originally posted by @LonelyCat124 in #3205 (comment)