How to use the iminuit.describe function in iminuit

To help you get started, we’ve selected a few iminuit 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 marinang / lauztat / statnight / model.py View on Github external
def describe(function):
    return iminuit.describe(function)
github marinang / lauztat / statnight / utils / wrappers.py View on Github external
def __init__(self, lossfunction):

        self._lossfunction = lossfunction
        self._parameters = describe(lossfunction)
        lossattrs = dir(lossfunction)

        model = next(a for a in lossattrs if a in ["model", "pdf", "f"])
        if model is None:
            raise ValueError("Model not found in loss function.")

        self._model = getattr(lossfunction, model)

        if not isinstance(self._model, ModelWrapper):
            raise ValueError("Model need to be wrapped under\
                             statnight.utils.ModelWrapper.")

        self._data = getattr(lossfunction, "data", None)
        if self._data is None:
            raise ValueError("Data not found in loss function.")
github marinang / lauztat / statnight / utils / wrappers.py View on Github external
def __init__(self, model, Spaces=[], variables=[], extended=False):
        """
        __init__ function
        """
        hascall = hasattr(model, "__call__")
        hasintegrate = hasattr(model, "integrate")

        if not(hascall and hasintegrate):
            msg = "{0} doesn't seem to be a model."
            raise ValueError(msg.format(model))

        self._model = model
        self._parameters = describe(model)
        self._extended = extended

        self._obs = check_obs(Spaces)
        self._vars = check_vars(variables)
        self._check_params()
        self.func_code = func_code(self.parameters)
github marinang / lauztat / statnight / utils / wrappers.py View on Github external
def __init__(self, func, parameters=[]):
        """
        __init__ function
        """
        hascall = hasattr(func, "__call__")
        hasintegrate = hasattr(func, "integrate")

        if not(hascall and hasintegrate):
            msg = "{0} doesn't seem to be a model."
            raise ValueError(msg.format(func))

        self._func = func
        self._parameters = describe(func)

        self.func_code = func_code(self.parameters)

        self.extended = False

iminuit

Jupyter-friendly Python frontend for MINUIT2 in C++

MIT
Latest version published 25 days ago

Package Health Score

84 / 100
Full package analysis

Similar packages