Ameobea / orange3

Orange 3 data mining suite: http://orange.biolab.si
Other
1 stars 0 forks source link

Deal with widgets that don't have implemented code generators #2

Open Ameobea opened 8 years ago

Ameobea commented 8 years ago

It's a fact that code generation will not be implemented for all available widgets. In order for generated scripts to now break when outputting the placeholder code, it will be necessary to implement a system for detecting nodes that don't have implemented code generators.

The preferable method to accomplish this is to clip the generated linear topology at the point where the unimplemented module becomes a dependency. By doing this, it will preserve potential other pathways through the code and allow for users to manually insert code at the break point, utilizing the automatic generator as much as possible.

┆Issue is synchronized with this Asana task

Ameobea commented 8 years ago

Currently, the default code generator for the widget base class simply inserts code that does nothing. This is not a problem in and of itself (it won't break the export process or make it impossible to export schemes that have nodes without code generators) but it will almost certainly make the generated code not work.

As mentioned in the first comment, one way to address this would be to check during the linear sorted topology to see if the nodes being added have included code generators and if not to cut off the the tree at that node (making it an unmet dependency). The only problem with this is that in the current version of the code, the scheme function to sort the DAG doesn't have access to the widgets, only the nodes. It is likely that the node to widget code will have to be moved from its current place to somewhere in the topology sorter function.