How to use the sherpa.utils.NoNewAttributesAfterInit.__init__ function in sherpa

To help you get started, we’ve selected a few sherpa examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sherpa / sherpa / sherpa / fit.py View on Github external
else:
                self.thaw_indices = self.thaw_indices + (iter,)
            iter = iter + 1
        self.current_frozen = -1

        # The number of times that reminimization has occurred
        # during an attempt to compute confidence limits.  If
        # that number equals self.estmethod.maxfits, cease all
        # further attempt to reminimize.
        self.refits = 0

        # Set up an IterFit object, so that the user can select
        # an iterative fitting option.
        self._iterfit = IterFit(self.data, self.model, self.stat, self.method,
                                itermethod_opts)
        NoNewAttributesAfterInit.__init__(self)
github sherpa / sherpa / sherpa / sim / simulate.py View on Github external
def __init__(self, ratios, stats, samples, lr, ppp, null, alt):
        self.ratios = numpy.asarray(ratios)
        self.stats = numpy.asarray(stats)
        self.samples = numpy.asarray(samples)
        self.lr = float(lr)
        self.ppp = float(ppp)
        self.null = float(null)
        self.alt = float(alt)
        NoNewAttributesAfterInit.__init__(self)
github sherpa / sherpa / sherpa / plot / __init__.py View on Github external
def __init__(self):
        """
        Initialize a Histogram object.  All 1D histogram plot
        instances utilize Histogram, which provides a generic
        interface to a backend.

        Once an instance of Histogram is initialized no new
        attributes of the class can be made. (To eliminate
        the accidental creation of erroneous attributes)
        """
        self.histo_prefs = self.histo_prefs.copy()
        NoNewAttributesAfterInit.__init__(self)
github sherpa / sherpa / sherpa / data.py View on Github external
def __init__(self, name, datasets):
        self.name = name
        if len(datasets) == 0:
            raise DataErr('zerodatasimulfit', type(self).__name__)
        self.datasets = tuple(datasets)
        NoNewAttributesAfterInit.__init__(self)
github sherpa / sherpa / sherpa / models / model.py View on Github external
def __init__(self, name, pars=()):
        self.name = name
        self.type = self.__class__.__name__.lower()
        self.pars = tuple(pars)
        self.is_discrete = False
        NoNewAttributesAfterInit.__init__(self)
github sherpa / sherpa / sherpa / fit.py View on Github external
self.methodname = type(fit.method).__name__.lower()
        self.itermethodname = fit._iterfit.itermethod_opts['name']
        statname = type(fit.stat).__name__.lower()
        if isinstance(fit.stat, Chi2) and not isinstance(fit.stat, LeastSq):
            isSimulFit = isinstance(fit.data, DataSimulFit)
            if isSimulFit:
                is_error_set = [
                    d.staterror is not None for d in fit.data.datasets]
                if all(is_error_set):
                    statname = 'chi2'
            elif fit.data.staterror is not None:
                statname = 'chi2'
        self.statname = statname
        self.datasets = None  # To be filled by calling function
        self.param_warnings = param_warnings
        NoNewAttributesAfterInit.__init__(self)
github sherpa / sherpa / sherpa / plot / __init__.py View on Github external
def __init__(self):
        """
        Initialize a Contour object.  All 2D contour plot
        instances utilize Contour, which provides a generic
        interface to a backend.

        Once an instance of Contour is initialized no new
        attributes of the class can be made. (To eliminate
        the accidental creation of erroneous attributes)
        """
        self.contour_prefs = self.contour_prefs.copy()
        NoNewAttributesAfterInit.__init__(self)
github sherpa / sherpa / sherpa / sim / __init__.py View on Github external
def __init__(self, data, model):
        self.data = data
        self.model = model
        NoNewAttributesAfterInit.__init__(self)
        return
github sherpa / sherpa / sherpa / astro / io / wcs.py View on Github external
def __init__(self, name, type, crval, crpix, cdelt,
                 crota=0.0, epoch=2000.0, equinox=2000.0):
        self.name = name
        self.type = type
        self.crval = numpy.asarray(crval, dtype=float)
        self.crpix = numpy.asarray(crpix, dtype=float)
        self.cdelt = numpy.asarray(cdelt, dtype=float)
        self.crota = crota
        self.epoch = epoch
        self.equinox = equinox
        NoNewAttributesAfterInit.__init__(self)