Skip to content

Commit

Permalink
fix liketats/lower ND limits, add example to doc
Browse files Browse the repository at this point in the history
  • Loading branch information
cmbant committed Aug 3, 2023
1 parent 2c25363 commit 2734228
Show file tree
Hide file tree
Showing 4 changed files with 174 additions and 85 deletions.
135 changes: 94 additions & 41 deletions docs/plot_gallery.html

Large diffs are not rendered by default.

113 changes: 73 additions & 40 deletions docs/plot_gallery.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion getdist/mcsamples.py
Original file line number Diff line number Diff line change
Expand Up @@ -2103,7 +2103,7 @@ def _setLikeStats(self):
for i, cont in enumerate(m.ND_contours):
region = self.samples[indexes[:cont], j]
par.ND_limit_bot[i] = np.min(region)
par.ND_limit_bot[i] = np.max(region)
par.ND_limit_top[i] = np.max(region)
par.bestfit_sample = self.samples[bestfit_ix][j]

self.likeStats = m
Expand Down
9 changes: 6 additions & 3 deletions getdist/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from io import BytesIO
import numpy as np
import tempfile
from getdist.paramnames import ParamInfo, ParamList
from getdist.paramnames import ParamInfo, ParamList, makeList
from types import MappingProxyType

empty_dict = MappingProxyType({})
Expand Down Expand Up @@ -272,7 +272,7 @@ def __init__(self, ncol, results, limit=2, tableParamNames=None, titles=None, fo
"""
:param ncol: number of columns
:param results: a :class:`MargeStats` or :class:`BestFit` instance, or a list of them for
comparing different results
comparing different results, or an MCSamples instance for white getMargeStats() will be called.
:param limit: which limit to include (1 is first limit calculated, usually 68%, 2 the second, usually 95%)
:param tableParamNames: optional :class:`~.paramnames.ParamNames` instance listing particular
parameters to include
Expand All @@ -285,7 +285,10 @@ def __init__(self, ncol, results, limit=2, tableParamNames=None, titles=None, fo
:param shiftSigma_indep: show parameter shifts in sigma assuming data are independent
:param shiftSigma_subset: show parameter shifts in sigma assuming data are a subset of each other
"""
# results is a margeStats or bestFit table
results = list(makeList(results))
for i, res in enumerate(results):
if getMargeStats := getattr(res, "getMargeStats", None):
results[i] = getMargeStats()
self.lines = []
if formatter is None:
self.format = NoLineTableFormatter()
Expand Down

0 comments on commit 2734228

Please sign in to comment.