Source code for dessn.framework.model

import logging
import os
from abc import ABC, abstractmethod


[docs]class Model(ABC): def __init__(self, filename): self.logger = logging.getLogger(__name__) self.filename = filename self.name = os.path.basename(filename) self.logger.info("Model created with stan file %s" % self.filename) @abstractmethod
[docs] def get_init(self, **kwargs): raise NotImplementedError()
@abstractmethod
[docs] def get_name(self): raise NotImplementedError()
@abstractmethod
[docs] def get_data(self, simulation, cosmology_index): raise NotImplementedError()
@abstractmethod
[docs] def get_parameters(self): raise NotImplementedError()
[docs] def get_stan_file(self): return self.filename
[docs] def correct_chain(self, dictionary, simulation, data): return dictionary
@abstractmethod
[docs] def get_labels(self): raise NotImplementedError()
[docs] def get_init_wrapped(self, **kwargs): def init(): return self.get_init(**kwargs) return init
@abstractmethod
[docs] def get_cosmo_params(self): raise NotImplementedError()