aiidateam / aiida-core

The official repository for the AiiDA code
https://aiida-core.readthedocs.io
Other
436 stars 190 forks source link

Error when using old workflows with new plugin system #594

Closed greschd closed 6 years ago

greschd commented 7 years ago

When trying to run an old workflow from a plugin (using the new plugin system), the following error appears (in orm/implementation/django/workflow.py and orm/implementation/sqlalchemy/workflow.py):

# Accept only the aiida.workflows packages
if caller_module == None or not caller_module.__name__.startswith("aiida.workflows"):
    raise SystemError("The superclass can't be called directly")

That's because the plugin workflow no longer belongs to the "aiida.workflows" module. This should be a pretty easy fix (just remove this check), but I'm not sure if this check is actually important, in which case some replacement would be needed.

sphuber commented 6 years ago

Fixing this by removing the check may raise other issues that might not be directly obvious. The only reason to fix this is to support using the new style plugin system with the old-style workflows. Since the old workflows are going to be deprecated, we don't want to encourage new users to develop old workflows. For already existing workflows, this problem does not apply, because they can just be placed in the aiida.workflows.user module for them to be loadable.

The solution is then to just add a paragraph to the documentation that explains that old workflows cannot be used with the plugin system, but rather they should be placed in the user workflows directory

sphuber commented 6 years ago

Fixed in PR #1042