diff --git a/lisa/energy_model.py b/lisa/energy_model.py index 870b3515ce4095f31fe21c1fe78b2a9f31a13cec..2b44258e0a7e394062fccd646103c1959a27e46b 100644 --- a/lisa/energy_model.py +++ b/lisa/energy_model.py @@ -78,9 +78,6 @@ class ActiveState(namedtuple('ActiveState', ['capacity', 'power'])): def __new__(cls, capacity=None, power=None): return super(ActiveState, cls).__new__(cls, capacity, power) - # helpers for yaml serialization - yaml_tag = 'em_active_state:capacity,power' - class _CpuTree(Loggable): """Internal class. Abstract representation of a CPU topology. diff --git a/lisa/utils.py b/lisa/utils.py index 041fa4557e3dde814d97451a41c8e67e5b3a3c9b..1f989bbb54eb836923847d45395181483975d5d2 100644 --- a/lisa/utils.py +++ b/lisa/utils.py @@ -108,13 +108,13 @@ def import_all_submodules(pkg): ] class UnknownTagPlaceholder: - def __init__(self, yaml_tag, data, location=None): - self.yaml_tag = yaml_tag + def __init__(self, tag, data, location=None): + self.tag = tag self.data = data self.location = location def __str__(self): - return ''.format(self.yaml_tag) + return ''.format(self.tag) class Serializable(Loggable): """ @@ -245,13 +245,6 @@ class Serializable(Loggable): @classmethod def _to_path(cls, instance, filepath, fmt): - # On Python >= 3.6, __init_subclass__ will take care of that - if sys.version_info < (3, 6): - # Better late than never. Doing it here avoids using a metaclass - # just to register the class. If we don't do that, yaml_tag class - # attribute will be ignored. - cls._yaml.register_class(type(instance)) - if fmt is None: fmt = cls.DEFAULT_SERIALIZATION_FMT @@ -353,12 +346,6 @@ class Serializable(Loggable): def __deepcopy__(self): return super().__deepcopy__() - # Will only be called with Python >= 3.6 - def __init_subclass__(cls, **kwargs): - # Register the class to ensure yaml_tag will be used - cls._yaml.register_class(cls) - super().__init_subclass__(**kwargs) - Serializable._init_yaml() class SerializableConfABC(Serializable, abc.ABC):