Skip to content

Commit

Permalink
Merge pull request #354 from California-Planet-Search/next-release
Browse files Browse the repository at this point in the history
Version 1.4.8
  • Loading branch information
bjfultn authored Oct 28, 2021
2 parents c68b889 + 79fe283 commit 5f5a35f
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 115 deletions.
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ requirements_file:
docs/requirements.txt
python:
setup_py_install: true
version: 2.7
version: 3.7
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ENV COVERALLS_REPO_TOKEN=7ZpQ0LQWM2PNl5iu7ZndyFEisQnZow8oT
RUN mkdir /code && \
mkdir /code/radvel && \
apt-get --yes update && \
apt-get install --yes gcc git && \
apt-get install --yes gcc git pkg-config libhdf5-100 libhdf5-dev && \
apt-get clean && \
conda config --add channels conda-forge && \
conda config --set channel_priority strict && \
Expand All @@ -26,7 +26,7 @@ RUN pip install --no-cache-dir -r requirements.txt
ADD . /code/radvel


CMD pip install --no-cache-dir --no-deps . && \
python setup.py build_ext -i && \
CMD python setup.py build_ext -i && \
pip install --no-cache-dir --no-deps . && \
nosetests radvel --with-coverage --cover-package=radvel && \
coveralls
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# needs_sphinx = '2.2'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ jupyter_client
ipykernel
pybind11
sphinx_rtd_theme
mock
194 changes: 97 additions & 97 deletions docs/tutorials/164922_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 @@ -29,7 +29,7 @@ def _custom_warningfmt(msg, *a, **b):
__all__ = ['model', 'likelihood', 'posterior', 'mcmc', 'prior', 'utils',
'fitting', 'report', 'cli', 'driver', 'gp']

__version__ = '1.4.7'
__version__ = '1.4.8'
__package__ = __path__[0]

MODULEDIR, filename = os.path.split(__file__)
Expand Down
3 changes: 2 additions & 1 deletion radvel/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from __future__ import print_function

import radvel
from radvel.likelihood import GPLikelihood
from radvel.plot import orbit_plots, mcmc_plots
from radvel.mcmc import statevars

Expand Down Expand Up @@ -67,7 +68,7 @@ def plots(args):
if hasattr(P, 'bjd0'):
args.plotkw['epoch'] = P.bjd0

if args.gp:
if args.gp or isinstance(post.likelihood, GPLikelihood):
GPPlot = orbit_plots.GPMultipanelPlot(
post, saveplot=saveto, **args.plotkw
)
Expand Down
36 changes: 26 additions & 10 deletions radvel/plot/orbit_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,18 @@ def __init__(self, post, saveplot=None, epoch=2450000, yscale_auto=False, yscale
else:
longp = max(self.post.likelihood.x) - min(self.post.likelihood.x)

self.dt = max(self.rvtimes) - min(self.rvtimes)
self.rvmodt = np.linspace(
min(self.rvtimes) - 0.05 * self.dt, max(self.rvtimes) + 0.05 * self.dt + longp,
int(resolution)
)
if self.set_xlim is not None:
self.dt = self.set_xlim[1] - self.set_xlim[0]
self.rvmodt = np.linspace(
(self.set_xlim[0]+self.epoch) - 0.05 * self.dt, (self.set_xlim[1]+self.epoch) + 0.05 * self.dt + longp,
int(resolution)
)
else:
self.dt = max(self.rvtimes) - min(self.rvtimes)
self.rvmodt = np.linspace(
min(self.rvtimes) - 0.05 * self.dt, max(self.rvtimes) + 0.05 * self.dt + longp,
int(resolution)
)

self.orbit_model = self.model(self.rvmodt)
self.rvmod = self.model(self.rvtimes)
Expand Down Expand Up @@ -506,7 +513,7 @@ def __init__(self, post, saveplot=None, epoch=2450000, yscale_auto=False, yscale
legend=True,
phase_limits=[], nobin=False, phasetext_size='large', figwidth=7.5, fit_linewidth=2.0,
set_xlim=None, text_size=9, legend_kwargs=dict(loc='best'), subtract_gp_mean_model=False,
plot_likelihoods_separately=False, subtract_orbit_model=False, status=None):
plot_likelihoods_separately=False, subtract_orbit_model=False, status=None, separate_orbit_gp=False):

super(GPMultipanelPlot, self).__init__(
post, saveplot=saveplot, epoch=epoch, yscale_auto=yscale_auto,
Expand All @@ -520,6 +527,7 @@ def __init__(self, post, saveplot=None, epoch=2450000, yscale_auto=False, yscale
self.subtract_gp_mean_model = subtract_gp_mean_model
self.plot_likelihoods_separately = plot_likelihoods_separately
self.subtract_orbit_model = subtract_orbit_model
self.separate_orbit_gp = separate_orbit_gp
if status is not None:
self.status = status

Expand Down Expand Up @@ -553,7 +561,11 @@ def plot_gp_like(self, like, orbit_model4data, ci):

if isinstance(like, radvel.likelihood.GPLikelihood):

xpred = np.linspace(np.min(like.x), np.max(like.x), num=int(3e3))
if self.set_xlim is not None:
xpred = np.linspace(self.set_xlim[0]+self.epoch, self.set_xlim[1]+self.epoch, num=int(3e3))
else:
xpred = np.linspace(np.min(like.x), np.max(like.x), num=int(3e3))

gpmu, stddev = like.predict(xpred)
if self.subtract_orbit_model:
gp_orbit_model = np.zeros(xpred.shape)
Expand Down Expand Up @@ -586,8 +598,12 @@ def plot_gp_like(self, like, orbit_model4data, ci):
ax.fill_between(xpred, gpmu+gp_orbit_model-stddev, gpmu+gp_orbit_model+stddev,
color=color, alpha=0.5, lw=0
)
ax.plot(xpred, gpmu+gp_orbit_model, 'b-', rasterized=False, lw=0.1)

if self.separate_orbit_gp:
ax.plot(xpred, gpmu, '-', color='orange', rasterized=False, lw=0.2, label='GP')
ax.plot(xpred, gp_orbit_model, 'g-', rasterized=False, lw=0.2, label="Orbit")
ax.plot(xpred, gpmu+gp_orbit_model, 'b-', rasterized=False, lw=0.4, label="Orbit+GP")
else:
ax.plot(xpred, gpmu+gp_orbit_model, 'b-', rasterized=False, lw=0.4)
else:
# plot orbit model
ax.plot(self.mplttimes, self.orbit_model, 'b-', rasterized=False, lw=0.1)
Expand All @@ -599,6 +615,7 @@ def plot_gp_like(self, like, orbit_model4data, ci):
ax.set_ylabel('RV [{ms:}]'.format(**plot.latex), weight='bold')
ticks = ax.yaxis.get_majorticklocs()
ax.yaxis.set_ticks(ticks[1:])
ax.xaxis.set_ticks([])

return ci

Expand Down Expand Up @@ -626,7 +643,6 @@ def plot_timeseries(self):
self.plttimes, self.rawresid+orbit_model4data, self.rverr,
self.post.likelihood.telvec, ax, telfmts=self.telfmts
)

if self.set_xlim is not None:
ax.set_xlim(self.set_xlim)
else:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ jupyter_client>=5.2.4
ipykernel>=4.10.0
jinja2>=2.9
python-dateutil>=2.5.0
h5py
h5py==2.10.0
dill

0 comments on commit 5f5a35f

Please sign in to comment.