diff --git a/MCcubed/VERSION.py b/MCcubed/VERSION.py index 63efd13..ff5ed83 100644 --- a/MCcubed/VERSION.py +++ b/MCcubed/VERSION.py @@ -4,4 +4,4 @@ # MC3 Version: MC3_VER = 2 # Major version MC3_MIN = 3 # Minor version -MC3_REV = 23 # Revision +MC3_REV = 24 # Revision diff --git a/MCcubed/mc/driver.py b/MCcubed/mc/driver.py index da3e0ef..f33b24d 100644 --- a/MCcubed/mc/driver.py +++ b/MCcubed/mc/driver.py @@ -29,7 +29,7 @@ def mcmc(data=None, uncert=None, func=None, indparams=None, fgamma=None, fepsilon=None, hsize=None, kickoff=None, plots=None, ioff=None, showbp=None, savefile=None, savemodel=None, resume=None, - rms=None, log=None, pnames=None, figpnames=None, + rms=None, log=None, pnames=None, texnames=None, full_output=None, chireturn=None, cfile=None, parname=None): """ @@ -147,10 +147,10 @@ def mcmc(data=None, uncert=None, func=None, indparams=None, Configuration file name. pnames: 1D string ndarray List of parameter names (including fixed and shared parameters) - to display on output screen and figures. See also figpnames. + to display on output screen and figures. See also texnames. Screen output trims up to the 11th character. - If not defined, default to figpnames. - figpnames: 1D string iterable + If not defined, default to texnames. + texnames: 1D string iterable Parameter names for figures, which may use latex syntax. If not defined, default to pnames. parname: 1D string ndarray @@ -418,9 +418,9 @@ def parse(): group.add_argument("--pnames", dest="pnames", action="store", type=mu.parray, default=None, help="List of parameter names for screen output (and " - "figures if figpnames is not defined). If pnames " - "is not defined, default to figpnames.") - group.add_argument("--figpnames", dest="figpnames", action="store", + "figures if texnames is not defined). If pnames " + "is not defined, default to texnames.") + group.add_argument("--texnames", dest="texnames", action="store", type=mu.parray, default=None, help="List of parameter names for figures (may use " "latex syntax). [default: None]") diff --git a/MCcubed/mc/mcmc.py b/MCcubed/mc/mcmc.py index 80bc1ac..aee3ce0 100644 --- a/MCcubed/mc/mcmc.py +++ b/MCcubed/mc/mcmc.py @@ -38,7 +38,7 @@ def mcmc(data, uncert=None, func=None, indparams=[], fgamma=1.0, fepsilon=0.0, hsize=1, kickoff='normal', plots=False, ioff=False, showbp=True, savefile=None, savemodel=None, resume=False, - rms=False, log=None, pnames=None, figpnames=None, + rms=False, log=None, pnames=None, texnames=None, full_output=False, chireturn=False, parname=None): """ @@ -144,10 +144,10 @@ def mcmc(data, uncert=None, func=None, indparams=[], Filename or File object to write log. pnames: 1D string iterable List of parameter names (including fixed and shared parameters) - to display on output screen and figures. See also figpnames. + to display on output screen and figures. See also texnames. Screen output trims up to the 11th character. - If not defined, default to figpnames. - figpnames: 1D string iterable + If not defined, default to texnames. + texnames: 1D string iterable Parameter names for figures, which may use latex syntax. If not defined, default to pnames. full_output: Bool @@ -261,14 +261,14 @@ def mcmc(data, uncert=None, func=None, indparams=[], uncert = np.ones(ndata) # Setup array of parameter names: - if pnames is None and figpnames is not None: - pnames = figpnames - elif pnames is not None and figpnames is None: - figpnames = pnames - elif pnames is None and figpnames is None: - pnames = figpnames = mu.default_parnames(nparams) - pnames = np.asarray(pnames) - figpnames = np.asarray(figpnames) + if pnames is None and texnames is not None: + pnames = texnames + elif pnames is not None and texnames is None: + texnames = pnames + elif pnames is None and texnames is None: + pnames = texnames = mu.default_parnames(nparams) + pnames = np.asarray(pnames) + texnames = np.asarray(texnames) # Set uncert as shared-memory object: sm_uncert = mpr.Array(ctypes.c_double, uncert) @@ -706,13 +706,13 @@ def mcmc(data, uncert=None, func=None, indparams=[], else: bestfreepars = None # Trace plot: - mp.trace(Z, Zchain=Zchain, burnin=Zburn, pnames=figpnames[ifree], + mp.trace(Z, Zchain=Zchain, burnin=Zburn, pnames=texnames[ifree], savefile=fname+"_trace.png") # Pairwise posteriors: - mp.pairwise(posterior, pnames=figpnames[ifree], bestp=bestfreepars, + mp.pairwise(posterior, pnames=texnames[ifree], bestp=bestfreepars, savefile=fname+"_pairwise.png") # Histograms: - mp.histogram(posterior, pnames=figpnames[ifree], bestp=bestfreepars, + mp.histogram(posterior, pnames=texnames[ifree], bestp=bestfreepars, savefile=fname+"_posterior.png", percentile=0.683, pdf=pdf, xpdf=xpdf) # RMS vs bin size: diff --git a/docs/mctutorial.rst b/docs/mctutorial.rst index 1cb5dfe..66b4bbc 100644 --- a/docs/mctutorial.rst +++ b/docs/mctutorial.rst @@ -281,16 +281,16 @@ The ``pnames`` argument (optional) define the names of the model parametes to be shown in the scren output and figure labels. In figures, the names can use LaTeX syntax. The screen output will display up to 11 characters. Thus, the user can define the -``figpnames`` argument (optional), display the appropriate syntax for +``texnames`` argument (optional), display the appropriate syntax for screen output and figures, for example: .. code-block:: python - pnames = ["log(alpha)", "beta", "Teff"] - figpnames = [r"$\log(\alpha)$", r"$\beta$", r"$T_{\rm eff}$"] + pnames = ["log(alpha)", "beta", "Teff"] + texnames = [r"$\log(\alpha)$", r"$\beta$", r"$T_{\rm eff}$"] -If ``figpnames`` is ``None``, it defaults to ``pnames``. If ``pnames`` -is ``None``, it defaults to ``figpnames``. If both arguments are +If ``texnames`` is ``None``, it defaults to ``pnames``. If ``pnames`` +is ``None``, it defaults to ``texnames``. If both arguments are ``None``, they default to a generic ``[Param 1, Param 2, ...]`` list. .. _walk: