shogun-toolbox / shogun

Shōgun
http://shogun-toolbox.org
BSD 3-Clause "New" or "Revised" License
3.03k stars 1.04k forks source link

Auto dispatch create methods in python #5118

Closed ghost closed 3 years ago

ghost commented 4 years ago

This fixes #4998 using the same technique that @gf712 suggested. I created a visitor for interface classes and changed the create method in class_list to accept the visitor. Then used this visitor in swig to transform the interface object to PyObject.

ghost commented 4 years ago

I can see this visitor being integrated into the GetterVisitor (making AnyVisitor inherit from InterfaceTypeVisitor for example, and defaulting the new methods to on(SGObject)). Does the parameter framework currently support "getting" objects of base classes? If no, I think this structure should be good for now.

gf712 commented 4 years ago

Does the parameter framework currently support "getting" objects of base classes?

Not yet, it's been worked on in #4793

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 3 years ago

This issue is now being closed due to a lack of activity. Feel free to reopen it.