Skip to content

Commit

Permalink
doc/url update
Browse files Browse the repository at this point in the history
  • Loading branch information
cmbant committed Aug 21, 2024
1 parent 45daf24 commit 649f4e0
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 28 deletions.
16 changes: 6 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ from Markov Chain Monte Carlo (MCMC).
* **Convergence diagnostics** - including correlation length and diagonalized Gelman-Rubin statistics
* **LaTeX tables** for marginalized 1D constraints

See the `Plot Gallery and tutorial <http://getdist.readthedocs.io/en/latest/plot_gallery.html>`_
See the `Plot Gallery and tutorial <https://getdist.readthedocs.io/en/latest/plot_gallery.html>`_
(`run online <https://mybinder.org/v2/gh/cmbant/getdist/master?filepath=docs%2Fplot_gallery.ipynb>`_)
and `GetDist Documentation <http://getdist.readthedocs.io/en/latest/index.html>`_.
and `GetDist Documentation <https://getdist.readthedocs.io/en/latest/index.html>`_.


Getting Started
Expand All @@ -45,10 +45,6 @@ Install getdist using pip::

or from source files using::

$ python setup.py install

or::

$ pip install -e /path/to/source/

You can test if things are working using the unit test by running::
Expand All @@ -59,7 +55,7 @@ Check the dependencies listed in the next section are installed. You can then us
use the GetDist GUI (*getdist-gui* command).

Once installed, the best way to get up to speed is probably to read through
the `Plot Gallery and tutorial <http://getdist.readthedocs.io/en/latest/plot_gallery.html>`_.
the `Plot Gallery and tutorial <https://getdist.readthedocs.io/en/latest/plot_gallery.html>`_.

Dependencies
=============
Expand All @@ -84,8 +80,8 @@ Samples file format
===================

GetDist can be used in scripts and interactively with standard numpy arrays
(as in the `examples <http://getdist.readthedocs.io/en/latest/plot_gallery.html>`_).
Scripts and the `GetDist GUI <http://getdist.readthedocs.io/en/latest/gui.html>`_ can also read parameter sample/chain files in plain text format
(as in the `examples <https://getdist.readthedocs.io/en/latest/plot_gallery.html>`_).
Scripts and the `GetDist GUI <https://getdist.readthedocs.io/en/latest/gui.html>`_ can also read parameter sample/chain files in plain text format
(or in the format output by the `Cobaya <https://cobaya.readthedocs.io>`__ sampling program).
In general plain text files of the form::

Expand Down Expand Up @@ -194,7 +190,7 @@ GetDist GUI

Run *getdist-gui* to run the graphical user interface. This requires PySide, but will run on Windows, Linux and Mac.
It allows you to open a folder of chain files, then easily select, open, plot and compare, as well as viewing standard GetDist outputs and tables.
See the `GUI Readme <http://getdist.readthedocs.io/en/latest/gui.html>`_.
See the `GUI Readme <https://getdist.readthedocs.io/en/latest/gui.html>`_.


Using with CosmoMC and Cobaya
Expand Down
11 changes: 6 additions & 5 deletions docs/source/gui.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ It allows you to open a folder of chain files, then easily select, open, plot an

.. image:: https://cdn.cosmologist.info/antony/getdist/gui_planck2018.png

It can open chain files under a selected directory structure (and also `paramgrid <https://cosmologist.info/cosmomc/readme_grids.html>`_ directories as show above).
It can open chain files under a selected directory structure (and also `paramgrid <https://cosmologist.info/cosmomc/readme_grids.html>`_ directories as show above,
or `Cobaya grids <https://cobaya.readthedocs.io/en/latest/grids.html>`_).
See the `intro <https://getdist.readthedocs.io/en/latest/intro.html>`_ for a description of chain file formats. A grid of sample chains files can be
downloaded `here <http://pla.esac.esa.int/pla/#cosmology>`_, after downloading a file just unzip and open the main directory in the GUI.
downloaded `here <https://pla.esac.esa.int/pla/#cosmology>`_, after downloading a file just unzip and open the main directory in the GUI.

After opening a directory, you can select each chain root name you want to plot. It is then added to the list box below.
The selected chains can be dragged and dropped to change the order if needed. Then select the parameter names to plot in the checkboxes below that,
Expand Down Expand Up @@ -49,11 +50,11 @@ To run the GUI you need PySide. This is not included in default dependencies, bu

pip install PySide6

You can also use PySide2, e.g. using `Anaconda <https://www.anaconda.com/distribution/>`_ to make a consistent new environment from conda-forge (which includes PySide2) e.g. ::
If you have conflicts, with Anaconda/miniconda you can make a consistent new environment
from conda-forge (which includes PySide6), e.g. ::

conda create -n py39forge -c conda-forge python=3.9 scipy matplotlib PyYAML PySide2
conda create -n myenv -c conda-forge scipy matplotlib PyYAML PySide6

Once PySide is set up, (re)install getdist and you should then be able to use the getdist-gui script on your path.
On a Mac the installation will also make a GetDist GUI Mac app, which you can find using Spotlight.

If you don't want to install dependencies locally, you can also use a pre-configured `virtual environment <https://cosmologist.info/CosmoBox/>`_.
2 changes: 0 additions & 2 deletions getdist/chains.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import os
import numpy as np
import re
from packaging import version
from getdist.paramnames import ParamNames, ParamInfo, escapeLatex
from getdist.convolve import autoConvolve
from getdist import cobaya_interface
import pickle
import logging
from copy import deepcopy
from collections import namedtuple
from typing import Sequence, Any, Optional, Union, List
Expand Down
12 changes: 6 additions & 6 deletions getdist/mcsamples.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ def getConvergeTests(self, test_confidence=0.95, writeDataToFile=False,
- 'MeanVar': Gelman-Rubin sqrt(var(chain mean)/mean(chain var)) test in individual parameters (multiple chains only)
- 'GelmanRubin': Gelman-Rubin test for the worst orthogonalized parameter (multiple chains only)
- 'SplitTest': Crude test for variation in confidence limits when samples are split up into subsets
- 'RafteryLewis': `Raftery-Lewis test <http://www.stat.washington.edu/tech.reports/raftery-lewis2.ps>`_ (integer weight samples only)
- 'RafteryLewis': `Raftery-Lewis test <https://stat.uw.edu/sites/default/files/files/reports/1991/tr212.pdf>`_ (integer weight samples only)
- 'CorrLengths': Sample correlation lengths
:param filename: The filename to write to, default is file_root.converge
:param feedback: If set to True, Prints the output as well as returning it.
Expand Down Expand Up @@ -1218,8 +1218,8 @@ def getAutoBandwidth1D(self, bins, par, param, mult_bias_correction_order=None,
m = max(m, 1)
if m:
# higher order method
# e.g. http://biomet.oxfordjournals.org/content/82/2/327.full.pdf+html
# some prefactors given in http://eprints.whiterose.ac.uk/42950/6/taylorcc2%5D.pdf
# e.g. https://doi.org/10.1093/biomet/82.2.327
# some prefactors given in https://eprints.whiterose.ac.uk/42950/6/taylorcc2%5D.pdf
# Here we just take unit prefactor relative to Gaussian
# and rescale the optimal h for standard KDE to accounts for higher order scaling
# Should be about 1.3 x larger for Gaussian, but smaller in some other cases
Expand Down Expand Up @@ -1359,7 +1359,7 @@ def _initParam(self, par, paramVec, mean=None, sddev=None, paramConfid=None):
paramConfid = paramConfid or self.initParamConfidenceData(paramVec)
# sigma_range is estimate related to shape of structure in the distribution = std dev for Gaussian
# search for peaks using quantiles,
# e.g. like simplified version of Janssen 95 (http://dx.doi.org/10.1080/10485259508832654)
# e.g. like simplified version of Janssen 95 (https://dx.doi.org/10.1080/10485259508832654)
confid_points = np.linspace(0.1, 0.9, 9)
confids = self.confidence(paramConfid,
np.array([self.range_confidence, 1 - self.range_confidence] + list(confid_points)))
Expand Down Expand Up @@ -1555,7 +1555,7 @@ def get1DDensityGridData(self, j, paramConfid=None, meanlikes=False, **kwargs):
raise SettingError('Unknown boundary_correction_order (expected 0, 1, 2)')
elif boundary_correction_order == 2:
# higher order kernel
# eg. see http://www.jstor.org/stable/2965571
# eg. see https://www.jstor.org/stable/2965571
xWin2 = kernel.Win * kernel.x ** 2
x2P = convolve1D(bins, xWin2, 'same', cache=cache)
a2 = np.sum(xWin2)
Expand All @@ -1573,7 +1573,7 @@ def get1DDensityGridData(self, j, paramConfid=None, meanlikes=False, **kwargs):
a0 = convolve1D(prior_mask, kernel.Win, 'same', cache=cache, cache_args=[2])
for _ in range(mult_bias_correction_order):
# estimate using flattened samples to remove second order biases
# mostly good performance, see http://www.jstor.org/stable/2965571 method 3,1 for first order
# mostly good performance, see https://www.jstor.org/stable/2965571 method 3,1 for first order
prob1 = density1D.P.copy()
prob1[prob1 == 0] = 1
fine = bins / prob1
Expand Down
1 change: 0 additions & 1 deletion getdist/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ def __init__(self, subplot_size_inch: float = 2, fig_width_inch: Optional[float]
self.constrained_layout = False
self.no_triangle_axis_labels = True

# see http://www.scipy.org/Cookbook/Matplotlib/Show_colormaps
self.colormap = "Blues"
self.colormap_scatter = "jet"
self.colorbar_tick_rotation = None
Expand Down
6 changes: 3 additions & 3 deletions getdist/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def times_ten_power(exponent):


def float_to_decimal(f):
# http://docs.python.org/library/decimal.html#decimal-faq
# https://docs.python.org/library/decimal.html#decimal-faq
"""Convert a floating point number to a Decimal with no loss of information"""
n, d = f.as_integer_ratio()
numerator, denominator = decimal.Decimal(n), decimal.Decimal(d)
Expand All @@ -46,7 +46,7 @@ def float_to_decimal(f):

# noinspection PyUnboundLocalVariable
def numberFigs(number, sigfig, sci=False):
# http://stackoverflow.com/questions/2663612/nicely-representing-a-floating-point-number-in-python/2663623#2663623
# https://stackoverflow.com/questions/2663612/nicely-representing-a-floating-point-number-in-python/2663623#2663623
assert (sigfig > 0)
try:
d = decimal.Decimal(number)
Expand Down Expand Up @@ -110,7 +110,7 @@ def namesigFigs(self, value, limplus, limminus, wantSign=True, sci=False):
if sci:
# First, call without knowing sig figs, to get the exponent
exponent = self.formatNumber(max(abs(value - limminus), abs(value + limplus)), sci=True)[1]
if exponent:
if exponent = self.formatNumber(max(abs(value - limminus), abs(value + limplus)), sci=True)[1]:
value, limplus, limminus = [
(lambda x: decimal.getcontext().multiply(
float_to_decimal(x), float_to_decimal(10. ** -exponent)))(lim)
Expand Down
2 changes: 1 addition & 1 deletion getdist/yaml_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class InputSyntaxError(Exception):

# Better loader for YAML
# 1. Matches 1e2 as 100 (no need for dot, or sign after e),
# from http://stackoverflow.com/a/30462009
# from https://stackoverflow.com/a/30462009
def yaml_load(text_stream, Loader=yaml.Loader, file_name=None):
class ScientificLoader(Loader):
pass
Expand Down

0 comments on commit 649f4e0

Please sign in to comment.