aiida-core icon indicating copy to clipboard operation
aiida-core copied to clipboard

CodeBuilder chokes on input plugin

Open ltalirz opened this issue 3 years ago • 2 comments

Describe the bug

In aiida 1.6.8, got an error when trying to use the CodeBuilder (same code worked fine in 2.0).

The error was here: https://github.com/aiidateam/aiida-core/blob/65f7ff8dee171fb158692455be5d25ddc67c0ee5/aiida/orm/utils/builders/code.py#L67

self._get_and_count('input_plugin', used) returned a string (e.g. 'quantumespresso.pw'), which has no .name attribute.

Removing the .name fixed the issue.

Your environment

  • Operating system [e.g. Linux]: ubuntu 20.04
  • Python version [e.g. 3.7.1]: 3.8
  • aiida-core version [e.g. 1.2.1]: 1.6.8

ltalirz avatar Jun 13 '22 09:06 ltalirz

The error in the PR seems to indicate that self._get_and_count('input_plugin', used) can return an entry point or a string, depending on circumstances. A proper fix will need to take both into account.

ltalirz avatar Jun 21 '22 14:06 ltalirz

Note that the code builder has been deprecated and this will be removed at some point

sphuber avatar Jun 24 '22 09:06 sphuber