4a8d4b647b79b5d0cea572d5951395bf98ba97c8,pyemma/_base/serialization/serialization.py,SerializableMixIn,_get_classes_to_inspect,#SerializableMixIn#,479

Before Change


    def _get_classes_to_inspect(self):
        from pyemma._base.estimator import Estimator
        from pyemma._base.model import Model
        return [c for c in self.__class__.mro() if
                hasattr(c, "_serialize_fields") and c._serialize_fields
                and c not in (SerializableMixIn,
                              object,
                              Estimator,
                              Model)]

    def __init_subclass__(self, *args, **kwargs):
        // ensure, that if this is subclasses, we have a proper class version.
        if not hasattr(self, "_serialize_version"):

After Change


        classes_with_custom_fields = [c for c in self.__class__.mro() if
                hasattr(c, "_serialize_fields") and c._serialize_fields]
        // sub classes of Estimator (base estimator might have their own parameters each
        estimator_classes = [c for c in self.__class__.mro() if (hasattr(c, "_get_param_names")
                             and hasattr(c, "_serialize_version"))]
        return classes_with_custom_fields + estimator_classes
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: markovmodel/PyEMMA
Commit Name: 4a8d4b647b79b5d0cea572d5951395bf98ba97c8
Time: 2017-11-28
Author: m.scherer@fu-berlin.de
File Name: pyemma/_base/serialization/serialization.py
Class Name: SerializableMixIn
Method Name: _get_classes_to_inspect


Project Name: quantumlib/Cirq
Commit Name: 16a906d54411fc5ea1e8d86b295a4e1e3c5a2d7d
Time: 2020-11-25
Author: dabacon@gmail.com
File Name: cirq/ionq/serializer.py
Class Name: Serializer
Method Name: _serialize_op


Project Name: mne-tools/mne-python
Commit Name: 03bc75e9067483166bb8ebbb2827ccaf45425031
Time: 2019-04-26
Author: OlehKSS@users.noreply.github.com
File Name: mne/utils/docs.py
Class Name:
Method Name: copy_base_doc_to_subclass_doc