@classmethod
def from_namespace(cls, namespace):
    """Initialise from argparser Namespace object."""
    config = cls()
    for slot in cls.__slots__:
        if slot.startswith('_'):
            slot = slot[1:]
        if not hasattr(namespace, slot):
            continue
        setattr(config, slot, getattr(namespace, slot))
    return config
