Module Expr Str ImportFrom alias ImportFrom alias Import alias FunctionDef arguments args NameParam NameParam defaults Call AttributeLoad NameLoad attr Str body Return ListComp IfExp Call AttributeLoad NameLoad attr Call NameLoad NameLoad Call AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str body Expr Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad If CompareIs NameLoad NameLoad body Return Str If Call NameLoad NameLoad NameLoad body Return BinOpMod Str NameLoad If Call NameLoad NameLoad NameLoad body Return BinOpMod NameLoad NameLoad orelse Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Num body Expr Str Assign NameStore Call NameLoad NameLoad Num Assign NameStore BinOpMod Str BinOpSub NameLoad Num If Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad BinOpMod Str BinOpSub NameLoad Num attr NameLoad If CompareGt Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareLt Call NameLoad NameLoad NameLoad body If CompareIn Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str If CompareNotIn Str SubscriptLoad NameLoad Slice NameLoad body Assign NameStore BinOpAdd BinOpAdd SubscriptLoad NameLoad Slice NameLoad Str SubscriptLoad NameLoad Slice NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str BinOpAdd BinOpMult Str BinOpSub NameLoad Call NameLoad NameLoad Str orelse Assign NameStore BinOpMod Str BinOpSub NameLoad Num Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Slice NameLoad If CompareLt Call NameLoad NameLoad NameLoad body Assign NameStore IfExp CompareIn Str NameLoad Str Str AugAssignAdd NameStore BinOpMult NameLoad BinOpSub NameLoad Call NameLoad NameLoad Return NameLoad decorator_list Assign NameStore Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad Num NameLoad body Expr Str If Call NameLoad NameLoad NameLoad body Assign TupleStore NameStore NameStore TupleLoad NameLoad NameLoad If Call NameLoad NameLoad Str body Assign NameStore NameLoad Assign NameStore AttributeLoad NameLoad attr If NameLoad body If Call NameLoad NameLoad body Assign NameStore NameLoad orelse Assign NameStore NameLoad Assign NameStore Call NameLoad NameLoad keyword NameLoad orelse Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore ListLoad Assign NameStore AttributeLoad NameLoad attr If CompareIsNot NameLoad NameLoad body Expr Call NameLoad Str Expr Call NameLoad BinOpMod Str Call NameLoad NameLoad Str Expr Call NameLoad BinOpMod Str Call NameLoad NameLoad Str Expr Call NameLoad BinOpMod Str Call NameLoad NameLoad Str Expr Call NameLoad BinOpMod Str Call NameLoad NameLoad Str Expr Call NameLoad BinOpMod Str Call NameLoad NameLoad Str Expr Call NameLoad BinOpMod Str Call NameLoad NameLoad Str Expr Call NameLoad BinOpMod Str Call NameLoad NameLoad Str Assign NameStore Call NameLoad ListComp Call NameLoad NameLoad comprehension NameStore NameLoad Expr Call NameLoad Str For NameStore NameLoad body Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore BinOpMult Str BinOpSub BinOpAdd NameLoad Num Call NameLoad NameLoad Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad Assign NameStore Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign NameStore BinOpMod Str AttributeLoad NameLoad attr If BoolOpAnd CompareIsNot NameLoad NameLoad CompareIn NameLoad NameLoad body Assign NameStore BinOpMod Str TupleLoad NameLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr TryExcept body Assign NameStore Call NameLoad AttributeLoad NameLoad attr handlers ExceptHandler type TupleLoad NameLoad NameLoad body Assign NameStore Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign NameStore Call NameLoad AttributeLoad NameLoad attr keyword Num TryExcept body Assign NameStore Call AttributeLoad Str attr Call NameLoad BinOpDiv AttributeLoad NameLoad attr AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Assign NameStore Str Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad NameLoad If AttributeLoad NameLoad attr body Expr Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad NameLoad orelse If CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad AttributeLoad NameLoad attr orelse Expr Call NameLoad BinOpMod Str TupleLoad NameLoad AttributeLoad NameLoad attr If NameLoad body Expr Call NameLoad BinOpMod NameLoad NameLoad Assign NameStore Dict For TupleStore NameStore NameStore Call NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Index NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Continue If BoolOpAnd Call NameLoad NameLoad Str CompareIsNot AttributeLoad NameLoad attr NameLoad body For NameStore SubscriptLoad NameLoad Slice BinOpAdd NameLoad Num body If BoolOpAnd CompareNotEq NameLoad NameLoad CompareIn NameLoad AttributeLoad NameLoad attr CompareGt Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad NameLoad body Assign SubscriptStore NameLoad Index BinOpMod Str TupleLoad NameLoad NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr keyword Lambda arguments args NameParam defaults Call NameLoad SubscriptLoad NameLoad Index Num Expr Call AttributeLoad NameLoad attr For TupleStore NameStore NameStore NameLoad body Assign NameStore Call NameLoad Num BinOpSub Num Call NameLoad NameLoad Expr Call NameLoad BinOpMod Str TupleLoad NameLoad SubscriptLoad BinOpMult Str Num Slice NameLoad NameLoad Return Call AttributeLoad Str attr NameLoad decorator_list FunctionDef arguments args NameParam defaults kwarg body Expr Str Expr Call NameLoad Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults kwarg body Expr Str Expr Call NameLoad Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad Num body Expr Str Assign NameStore Call NameLoad ListComp Call NameLoad NameLoad comprehension NameStore NameLoad Assign NameStore ListLoad Assign NameStore AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body If CompareLt Call NameLoad SubscriptLoad NameLoad Index Num Num body Return Str Return BinOpMod Str BinOpMult SubscriptLoad NameLoad Index Num Num decorator_list Assign NameStore NameLoad Assign NameStore NameStore BinOpMod Str NameLoad If NameLoad body Assign NameStore BinOpMod Str NameLoad For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body If UnaryOpNot NameLoad body Expr Call NameLoad Call AttributeLoad Str attr BinOpAdd ListLoad Call AttributeLoad Str attr BinOpAdd NameLoad Num ListComp Call AttributeLoad NameLoad attr BinOpAdd NameLoad Num comprehension NameStore Call NameLoad NameLoad NameLoad Assign NameStore NameLoad Assign NameStore ListLoad BinOpMod Str Call AttributeLoad NameLoad attr NameLoad Assign NameStore Num If NameLoad body For TupleStore NameStore NameStore NameLoad body If CompareLt Call NameLoad NameLoad Num body Assign NameStore NameLoad For TupleStore NameStore NameStore NameLoad body If CompareLt NameLoad Num body Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr BinOpSub NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr BinOpAdd NameLoad Num Expr Call NameLoad Call AttributeLoad Str attr NameLoad Return Call AttributeLoad Str attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call NameLoad Call NameLoad NameLoad decorator_list
N/A N/A 
Created on Fri Apr 20 19:24:21 2012

@author: Tillsten

Changes:
  -  13-Feb-2013 M Newville
     complemented  "report_errors" and "report_ci" with
     "error_report" and "ci_report" (respectively) which
     return the text of the report.  Thus report_errors()
     is simply:
        def report_errors(params, modelpars=None, show_correl=True):
            print error_report(params, modelpars=modelpars,
                               show_correl=show_correl)
     and similar for report_ci() / ci_report()

 __future__ print_function parameter Parameters N/A re alphanumeric_sort N/A N/A s _nsre N/A N/A N/A re compile ([0-9]+) N/A N/A N/A N/A N/A N/A text isdigit N/A int text N/A N/A text lower N/A text N/A N/A re split _nsre s N/A getfloat_attr N/A N/A obj attr fmt N/A %.3f N/A N/A format an attribute of an object for printing N/A val N/A getattr obj attr None N/A N/A val None N/A N/A unknown N/A N/A isinstance val int N/A N/A N/A %d val N/A N/A isinstance val float N/A N/A N/A fmt val N/A N/A N/A repr val N/A gformat N/A N/A val length N/A 11 N/A N/A format a number with '%g'-like format, except that
    the return will be length ``length`` (default=12)
    and have at least length-6 significant digits
     N/A length N/A max length 7 N/A fmt N/A {: .%ig} N/A length 6 N/A N/A isinstance val int N/A N/A out N/A N/A N/A {: .%ig} N/A length 2 format val N/A N/A N/A len out length N/A N/A out N/A N/A fmt format val N/A N/A out N/A N/A fmt format val N/A N/A N/A len out length N/A N/A N/A e out N/A N/A ie N/A N/A out find e N/A N/A . N/A out N/A ie N/A N/A out N/A N/A N/A out N/A ie . N/A out N/A ie N/A out N/A N/A out replace e N/A N/A 0 N/A length N/A len out e N/A N/A fmt N/A {: .%ig} N/A length 1 N/A out N/A N/A N/A fmt format val N/A length N/A N/A N/A len out length N/A N/A pad N/A N/A . out 0 N/A out N/A pad N/A length N/A len out N/A out N/A N/A CORREL_HEAD [[Correlations]] (unreported correlations are < % .3f) fit_report N/A N/A inpars modelpars show_correl min_correl sort_pars N/A None True 0.1 False N/A N/A return text of a report for fitted params best-fit values,
    uncertainties and correlations

    arguments
    ----------
       inpars       Parameters from fit or Minizer object returned from a fit.
       modelpars    Optional Known Model Parameters [None]
       show_correl  whether to show list of sorted correlations [True]
       min_correl   smallest correlation absolute value to show [0.1]
       sort_pars    If True, then fit_report will show parameter names
                    sorted in alphanumerical order.  If False, then the
                    parameters will be listed in the order they were added to
                    the Parameters dictionary. If sort_pars is callable, then
                    this (one argument) function is used to extract a
                    comparison key from each list element.
     N/A N/A isinstance inpars Parameters N/A N/A N/A result params N/A None inpars N/A N/A hasattr inpars params N/A N/A result inpars N/A params N/A inpars params N/A sort_pars N/A N/A N/A callable sort_pars N/A N/A key sort_pars N/A N/A key alphanumeric_sort N/A parnames N/A sorted params key key N/A N/A parnames N/A list N/A N/A params keys N/A buff N/A N/A add N/A buff append N/A N/A result None N/A N/A N/A add [[Fit Statistics]] N/A N/A add N/A     # function evals   = %s N/A getfloat_attr result nfev N/A N/A add N/A     # data points      = %s N/A getfloat_attr result ndata N/A N/A add N/A     # variables        = %s N/A getfloat_attr result nvarys N/A N/A add N/A     chi-square         = %s N/A getfloat_attr result chisqr N/A N/A add N/A     reduced chi-square = %s N/A getfloat_attr result redchi N/A N/A add N/A     Akaike info crit   = %s N/A getfloat_attr result aic N/A N/A add N/A     Bayesian info crit = %s N/A getfloat_attr result bic N/A namelen N/A max N/A N/A len n N/A n parnames N/A N/A add [[Variables]] N/A name parnames N/A N/A par N/A params N/A name N/A space N/A N/A N/A namelen 1 N/A len name N/A nout N/A %s:%s N/A name space N/A inval (init= ?) N/A N/A N/A par init_value None N/A N/A inval N/A (init=% .7g) N/A par init_value N/A N/A N/A modelpars None N/A name modelpars N/A N/A inval N/A %s, model_value =% .7g N/A inval N/A N/A modelpars N/A name value N/A N/A N/A sval N/A gformat N/A par value N/A N/A N/A N/A TypeError ValueError N/A N/A sval Non Numeric Value? N/A N/A N/A par stderr None N/A N/A serr N/A gformat N/A par stderr length 9 N/A N/A N/A spercent N/A N/A ({:.2%}) format N/A abs N/A N/A par stderr N/A par value N/A N/A N/A ZeroDivisionError N/A N/A spercent N/A sval N/A %s +/-%s %s N/A sval serr spercent N/A N/A par vary N/A N/A N/A add N/A     %s %s %s N/A nout sval inval N/A N/A N/A N/A par expr None N/A N/A N/A add N/A     %s %s  == '%s' N/A nout sval N/A par expr N/A N/A N/A add N/A     %s % .7g (fixed) N/A nout N/A par value N/A show_correl N/A N/A N/A add N/A CORREL_HEAD min_correl N/A correls N/A N/A N/A i name N/A enumerate parnames N/A N/A par N/A params N/A name N/A N/A N/A par vary N/A N/A N/A N/A N/A hasattr par correl N/A N/A par correl None N/A N/A name2 N/A parnames N/A N/A i 1 N/A N/A N/A N/A name name2 N/A name2 N/A par correl N/A N/A abs N/A N/A par correl N/A name2 min_correl N/A N/A N/A correls N/A N/A %s, %s N/A name name2 N/A N/A par correl N/A name2 N/A sort_correl N/A sorted N/A N/A correls items key N/A N/A N/A it N/A N/A abs N/A it N/A 1 N/A N/A N/A sort_correl reverse N/A N/A name val sort_correl N/A N/A lspace N/A max 1 N/A 25 N/A len name N/A N/A add N/A     C(%s)%s = % .3f  N/A name N/A N/A 30 N/A lspace val N/A N/A N/A join buff N/A report_errors N/A N/A params N/A kws N/A N/A print a report for fitted params:  see error_report() N/A N/A print N/A fit_report params kws N/A report_fit N/A N/A params N/A kws N/A N/A print a report for fitted params:  see error_report() N/A N/A print N/A fit_report params kws N/A ci_report N/A N/A ci with_offset ndigits N/A True 5 N/A N/A return text of a report for confidence intervals

    Parameters
    ----------
    with_offset : bool (default `True`)
        whether to subtract best value from all other values.
    ndigits : int (default 5)
        number of significant digits to show

    Returns
    -------
       text of formatted report on confidence intervals.
     N/A maxlen N/A max N/A N/A len i N/A i ci N/A buff N/A N/A add N/A buff append convp N/A N/A x N/A N/A N/A N/A N/A abs N/A x N/A 0 0.01 N/A N/A _BEST_ N/A N/A %.2f%% N/A N/A x N/A 0 100 N/A N/A title_shown False N/A fmt_best fmt_diff N/A {0:.%if} ndigits N/A with_offset N/A N/A fmt_diff N/A {0:+.%if} ndigits N/A N/A name row N/A N/A ci items N/A N/A N/A title_shown N/A N/A N/A add N/A N/A join N/A N/A N/A N/A rjust N/A maxlen 1 N/A N/A N/A i rjust N/A ndigits 5 N/A i N/A map convp row N/A title_shown True N/A thisrow N/A N/A  %s: N/A N/A name ljust maxlen N/A offset 0.0 N/A with_offset N/A N/A N/A cval val row N/A N/A N/A N/A abs cval 0.01 N/A N/A offset val N/A N/A cval val row N/A N/A N/A cval 0.01 N/A N/A sval N/A N/A fmt_best format val N/A N/A sval N/A N/A fmt_diff format N/A val offset N/A N/A N/A thisrow append N/A N/A sval rjust N/A ndigits 5 N/A N/A add N/A N/A join thisrow N/A N/A N/A join buff N/A report_ci N/A N/A ci N/A N/A N/A print a report for confidence intervals N/A N/A print N/A ci_report ci N/A