Skip to content
This repository was archived by the owner on May 21, 2024. It is now read-only.
This repository was archived by the owner on May 21, 2024. It is now read-only.

Error while trying to access draw or show methods #126

@tosaric

Description

@tosaric

I tried to access draw or show methods just like from the tutorial, but I get an error.
Here is minimal reproducible example:

from probfit import gaussian, UnbinnedLH
from iminuit import Minuit
unbinned_likelihood = UnbinnedLH(gaussian, xdata.values)
minuit = Minuit(unbinned_likelihood, mean=0, sigma=5)
unbinned_likelihood.draw(minuit)

And this is the errror I am getting:

AttributeError Traceback (most recent call last)
/var/folders/gj/xpkrsnhd2zl8gs7vsxy72bs40000gn/T/ipykernel_41791/1198878356.py in
1 minuit = Minuit(unbinned_likelihood, mean=0, sigma=5)
----> 2 unbinned_likelihood.draw(minuit)

probfit/costfunc.pyx in probfit.costfunc.UnbinnedLH.draw()

/opt/miniconda3/envs/astrometry/lib/python3.9/site-packages/probfit/plotting.py in draw_ulh(self, minuit, bins, ax, bound, parmloc, nfbins, print_par, grid, args, errors, parts, show_errbars, no_plot)
94 ax = plt.gca() if ax is None and not no_plot else ax
95
---> 96 arg, error = get_args_and_errors(self, minuit, args, errors)
97
98 n, e = np.histogram(self.data, bins=bins, range=bound, weights=self.weights)

/opt/miniconda3/envs/astrometry/lib/python3.9/site-packages/probfit/plotting.py in get_args_and_errors(self, minuit, args, errors)
40 ret_error = None
41 if minuit is not None: # case 1
---> 42 ret_arg = minuit.args
_ 43 ret_error = minuit.errors

44 return ret_arg, ret_error

AttributeError: 'Minuit' object has no attribute 'args'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions