Source code for smif.convert.register

"""Register and ResolutionSet abstract classes to contain area and interval
metadata.
"""
from abc import ABCMeta, abstractmethod


[docs]class Register(metaclass=ABCMeta):
[docs] @abstractmethod def register(self, resolution_set): raise NotImplementedError
[docs] @abstractmethod def get_entry(self, name): """Implement to return the smif.convert.ResolutionSet associated with the `name` Arguments --------- name : str The unique identifier of the ResolutionSet """ raise NotImplementedError
[docs]class ResolutionSet(metaclass=ABCMeta): def __init__(self): self.name = '' self.description = '' self.data = []
[docs] def as_dict(self): """ """ return {'name': self.name, 'description': self.description}
[docs] @abstractmethod def get_entry_names(self): """Get the names of the entries in the ResolutionSet Returns ------- set The set of names which identify each entry in the ResolutionSet """ raise NotImplementedError