Skip to content

Commit

Permalink
πŸ‘Œ IMPROVE: Warning message for group with no entry point
Browse files Browse the repository at this point in the history
closes #3919
  • Loading branch information
chrisjsewell authored Aug 12, 2021
1 parent 922034f commit b971f3c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions aiida/orm/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ def __new__(cls, name, bases, namespace, **kwargs):
from aiida.plugins.entry_point import get_entry_point_from_class

newcls = ABCMeta.__new__(cls, name, bases, namespace, **kwargs) # pylint: disable=too-many-function-args

entry_point_group, entry_point = get_entry_point_from_class(namespace['__module__'], name)

mod = namespace['__module__']
entry_point_group, entry_point = get_entry_point_from_class(mod, name)

if entry_point_group is None or entry_point_group != 'aiida.groups':
newcls._type_string = None
message = f'no registered entry point for `{name}` so its instances will not be storable.'
message = f'no registered entry point for `{mod}:{name}` so its instances will not be storable.'
warnings.warn(message) # pylint: disable=no-member
else:
newcls._type_string = entry_point.name # pylint: disable=protected-access
Expand Down

0 comments on commit b971f3c

Please sign in to comment.