Skip to content

Commit

Permalink
Merge pull request #159 from California-Planet-Search/next-release
Browse files Browse the repository at this point in the history
Version 1.1.7
  • Loading branch information
bjfultn authored Mar 12, 2018
2 parents d3cf0af + 46541c7 commit be20db4
Show file tree
Hide file tree
Showing 21 changed files with 453 additions and 453 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ before_install:
- sudo ln -s /run/shm /dev/shm

install:
- conda install --yes pip numpy scipy matplotlib cython pandas nose nbformat nbconvert jupyter_client ipykernel
- conda install --yes pip numpy scipy matplotlib cython pandas nose nbformat nbconvert jupyter_client ipykernel tornado==4.5.3
- if [ ${py} == "2" ]; then conda install --yes configparser==3.5.0b2; fi
- pip install coveralls celerite
- pip install coveralls pybind11
- pip install celerite
- pip install .
- python setup.py build_ext -i

Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ global-include src/*.pyx
global-include src/*.c
include requirements.txt
include example_data/*
recursive-include radvel/templates *
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ General Toolkit for Modeling Radial Velocities.

## Attribution

Written by BJ Fulton, Erik Petigura, Sarah Blunt, and Evan Sinukoff. Fulton et al. (submitted to PASP)
Written by BJ Fulton, Erik Petigura, Sarah Blunt, and Evan Sinukoff. [Fulton et al. (2017)](http://adsabs.harvard.edu/cgi-bin/bib_query?arXiv:1801.01947)

Please cite the [original publication](http://adsabs.harvard.edu/abs/2018arXiv180101947F) and the following DOI if you make use of this software in your research.
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.580821.svg)](https://doi.org/10.5281/zenodo.580821)
Expand Down
142 changes: 69 additions & 73 deletions docs/tutorials/164922_Fitting+MCMC.ipynb

Large diffs are not rendered by default.

107 changes: 51 additions & 56 deletions docs/tutorials/K2-24_Fitting+MCMC.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion radvel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
__all__=['model', 'likelihood', 'posterior', 'mcmc', 'prior', 'utils',
'fitting', 'report', 'cli', 'driver', 'gp']

__version__ = '1.1.6'
__version__ = '1.1.7'

MODULEDIR, filename = os.path.split(__file__)
DATADIR = os.path.join(sys.prefix, 'radvel_example_data')
Expand Down
2 changes: 1 addition & 1 deletion radvel/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def main():
args.outputdir = outdir

if not os.path.isdir(args.outputdir):
os.mkdir(outdir)
os.mkdir(args.outputdir)

args.func(args)

Expand Down
6 changes: 3 additions & 3 deletions radvel/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def tables(args):
post = radvel.posterior.load(status.get('fit', 'postfile'))
chains = pd.read_csv(status.get('mcmc', 'chainfile'))
report = radvel.report.RadvelReport(P, post, chains)

tabletex = radvel.report.TexTable(report)
for tabtype in args.type:
print("Generating LaTeX code for {} table".format(tabtype))

Expand All @@ -281,9 +281,9 @@ def tables(args):
report = radvel.report.RadvelReport(
P, post, chains, compstats=compstats
)
tex = report.tabletex(tabtype='nplanets')
tex = tabletex.tab_comparison()
else:
tex = report.tabletex(tabtype=tabtype)
tex = tabletex.tab_comparison()

saveto = os.path.join(
args.outputdir, '{}_{}_.tex'.format(conf_base,tabtype)
Expand Down
27 changes: 0 additions & 27 deletions radvel/mcmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,33 +263,6 @@ def mcmc(post, nwalkers=50, nrun=10000, ensembles=8, checkinterval=50, burnGR=1.

return df

def draw_models_from_chain(mod, chain, t, nsamples=50):
"""Draw Models from Chain
Given an MCMC chain of parameters, draw representative parameters
and synthesize models.
Args:
mod (radvel.RVmodel) : RV model
chain (DataFrame): pandas DataFrame with different values from MCMC
chain
t (array): time range over which to synthesize models
nsamples (int): number of draws
Returns:
array: 2D array with the different models as different rows
"""

np.random.seed(0)
chain_samples = chain.ix[np.random.choice(chain.index, nsamples)]
models = []
for i in chain_samples.index:
params = np.array( chain.ix[i, mod.vary_parameters] )
params = mod.array_to_params(params)
models += [mod.model(params, t)]
models = np.vstack(models)
return models


def gelman_rubin(pars0, minTz, maxGR):
"""Gelman-Rubin Statistic
Expand Down
Loading

0 comments on commit be20db4

Please sign in to comment.