Skip to content

Commit

Permalink
Merge pull request #382 from California-Planet-Search/next-release
Browse files Browse the repository at this point in the history
Version 1.4.11
  • Loading branch information
bjfultn authored Sep 14, 2023
2 parents 86990c1 + 4175b55 commit b279a88
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 45 deletions.
18 changes: 10 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM conda/miniconda3
FROM continuumio/miniconda3

ENV TERM=xterm
ENV TERMINFO=/etc/terminfo
Expand All @@ -9,13 +9,15 @@ ENV COVERALLS_REPO_TOKEN=7ZpQ0LQWM2PNl5iu7ZndyFEisQnZow8oT
RUN mkdir /code && \
mkdir /code/radvel && \
apt-get --yes update && \
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 && \
conda update -n base -c defaults conda && \
conda install --yes nomkl numpy pybind11 coveralls nose && \
conda install --yes -c conda-forge celerite && \
apt-get install --yes gcc git pkg-config libhdf5-hl-100 libhdf5-dev && \
apt-get clean

# RUN conda config --add channels conda-forge && \
# conda config --set channel_priority strict && \
# conda update -n base -c defaults conda

RUN conda install --yes nomkl numpy pybind11 coveralls nose
RUN conda install --yes -c conda-forge celerite && \
conda clean -afy

WORKDIR /code/radvel
Expand Down
9 changes: 6 additions & 3 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
numpy>=1.11
scipy>=0.17
numpy==1.24.3
scipy==1.10.1
matplotlib>=1.5.3
corner>=2.0
cython>=0.23
astropy>=1.1.2
emcee>=3.0.0
pandas>=0.20.0
nbsphinx
nbsphinx==0.9.3
nbconvert==7.8.0
mistune==3.0.1
jupyter_client
ipykernel
pybind11
sphinx_rtd_theme
mock
docutils==0.16
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build-system]
requires = ["setuptools", "wheel", "Cython", "pybind11", "numpy"]
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.10'
__version__ = '1.4.11'
__package__ = __path__[0]

MODULEDIR, filename = os.path.split(__file__)
Expand Down
2 changes: 2 additions & 0 deletions radvel/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,8 @@ def report(args):
"{}_radvel.stat".format(conf_base))

status = load_status(statfile)
if 'ic_compare' in status.keys():
status['ic_compare']['ic'] = status['ic_compare']['ic'].replace('-inf', '-np.inf')

P, post = radvel.utils.initialize_posterior(config_file)
post = radvel.posterior.load(status.get('fit', 'postfile'))
Expand Down
18 changes: 9 additions & 9 deletions radvel/mcmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,15 @@ def mcmc(post, nwalkers=50, nrun=10000, ensembles=8, checkinterval=50, minAfacto
else:
check_gp = isinstance(post.likelihood, radvel.likelihood.GPLikelihood)

np_info = np.__config__.blas_opt_info
if 'extra_link_args' in np_info.keys() \
and check_gp \
and ('-Wl,Accelerate' in np_info['extra_link_args']) \
and serial == False:
print("WARNING: Parallel processing with Gaussian Processes will not work with your current"
+ " numpy installation. See radvel.readthedocs.io/en/latest/OSX-multiprocessing.html"
+ " for more details. Running in serial with " + str(ensembles) + " ensembles.")
serial = True
# np_info = np.__config__.blas_opt_info
# if 'extra_link_args' in np_info.keys() \
# and check_gp \
# and ('-Wl,Accelerate' in np_info['extra_link_args']) \
# and serial == False:
# print("WARNING: Parallel processing with Gaussian Processes will not work with your current"
# + " numpy installation. See radvel.readthedocs.io/en/latest/OSX-multiprocessing.html"
# + " for more details. Running in serial with " + str(ensembles) + " ensembles.")
# serial = True

statevars.ensembles = ensembles
statevars.nwalkers = nwalkers
Expand Down
16 changes: 10 additions & 6 deletions radvel/plot/orbit_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ def __init__(self, post, saveplot=None, epoch=2450000, yscale_auto=False, yscale
self.yscale_sigma = yscale_sigma
if phase_ncols is None:
self.phase_ncols = 1
else:
self.phase_ncols = phase_ncols
if phase_nrows is None:
self.phase_nrows = self.post.likelihood.model.num_planets
else:
self.phase_nrows = phase_nrows
self.uparams = uparams
self.rv_phase_space = rv_phase_space
self.telfmts = telfmts
Expand Down Expand Up @@ -234,21 +238,21 @@ def plot_timeseries(self):

def plot_residuals(self):
"""
Make a plot of residuals and RV trend in the current Axes.
Make a plot of residuals in the current Axes.
"""

ax = pl.gca()

ax.plot(self.mplttimes, self.slope, 'b-', lw=self.fit_linewidth)
ax.plot(self.mplttimes, self.slope-self.slope, 'b-', lw=self.fit_linewidth)

plot.mtelplot(self.plttimes, self.resid, self.rverr, self.post.likelihood.telvec, ax, telfmts=self.telfmts)
plot.mtelplot(self.plttimes, self.rawresid, self.rverr, self.post.likelihood.telvec, ax, telfmts=self.telfmts)
if not self.yscale_auto:
scale = np.std(self.resid)
scale = np.std(self.rawresid)
ax.set_ylim(-self.yscale_sigma * scale, self.yscale_sigma * scale)

if self.highlight_last:
ind = np.argmax(self.plttimes)
pl.plot(self.plttimes[ind], self.resid[ind], **plot.highlight_format)
pl.plot(self.plttimes[ind], self.rawresid[ind], **plot.highlight_format)

if self.set_xlim is not None:
ax.set_xlim(self.set_xlim)
Expand Down Expand Up @@ -688,7 +692,7 @@ def plot_multipanel(self, nophase=False):
scalefactor = self.phase_nrows

n_likes = len(self.like_list)
figheight = self.ax_rv_height*(n_likes+0.5) + self.ax_phase_height * scalefactor
figheight = self.ax_rv_height*(n_likes//self.phase_ncols+1.5) + self.ax_phase_height * scalefactor

# provision figure
fig = pl.figure(figsize=(self.figwidth, figheight))
Expand Down
4 changes: 2 additions & 2 deletions radvel/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,9 @@ def test_model_comp(setupfn='example_planets/HD164922.py'):
#test_k2()
#test_hd()
#test_model_comp()
#test_k2131()
test_k2131()
#test_celerite()
test_basis()
# test_basis()
#test_kernels()
#test_kepler()
#test_priors()
10 changes: 6 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
cython>=0.23
numpy>=1.16
scipy>=0.17
numpy==1.24.3
scipy==1.10.1
matplotlib>=1.5.3
corner>=2.0
astropy>=1.1.2
emcee>=3.0.2
pandas>=0.20.0
nbsphinx>=0.3.3
nbsphinx==0.9.3
jupyter_client>=5.2.4
ipykernel>=4.10.0
jinja2>=2.9
python-dateutil>=2.5.0
h5py==2.10.0
h5py>=3.9.0
dill
ipython
coveralls==3.2.0
18 changes: 6 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
from setuptools import setup, find_packages, Extension
from setuptools.command.build_ext import build_ext as _build_ext
import re


class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process:
__builtins__.__NUMPY_SETUP__ = False
import numpy
self.include_dirs.append(numpy.get_include())

import numpy

def get_property(prop, project):
result = re.search(r'{}\s*=\s*[\'"]([^\'"]*)[\'"]'.format(prop),
open(project + '/__init__.py').read())
return result.group(1)


extensions = [Extension("radvel._kepler", ["src/_kepler.pyx"],)]
extensions = [
Extension(
"radvel._kepler", ["src/_kepler.pyx"],
include_dirs=[numpy.get_include()])
]

reqs = []
for line in open('requirements.txt', 'r').readlines():
Expand All @@ -32,7 +27,6 @@ def get_property(prop, project):
packages=find_packages(),
setup_requires=['numpy', 'cython'],
ext_modules=extensions,
cmdclass={'build_ext': build_ext},
data_files=[
(
'radvel_example_data',
Expand Down

0 comments on commit b279a88

Please sign in to comment.