Skip to content

Commit

Permalink
πŸ‘Œ IMPROVE: Warning message for group with no entry point (#5076)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell authored Aug 13, 2021
1 parent c041163 commit 77aa5a4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions aiida/orm/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ def __new__(cls, name, bases, namespace, **kwargs):

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 77aa5a4

Please sign in to comment.