コード例 #1
0
ファイル: base.py プロジェクト: tgebhart/pykeen
    def __init_subclass__(cls, **kwargs):
        """Initialize the subclass.

        This checks for all subclasses if they are tagged with :class:`abc.ABC` with :func:`inspect.isabstract`.
        All non-abstract deriving models should have citation information. Subclasses can further override
        ``__init_subclass__``, but need to remember to call ``super().__init_subclass__`` as well so this
        gets run.
        """
        if not inspect.isabstract(cls):
            parse_docdata(cls)
コード例 #2
0
ファイル: base.py プロジェクト: sbonner0/pykeen
 def __init_subclass__(cls, autoreset: bool = True, **kwargs):  # noqa:D105
     cls._is_base_model = not autoreset
     if not cls._is_base_model:
         _add_post_reset_parameters(cls)
         parse_docdata(cls)