diff --git a/Dockerfile b/Dockerfile index fc913792..4bd62bdd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM conda/miniconda3 +FROM continuumio/miniconda3 ENV TERM=xterm ENV TERMINFO=/etc/terminfo @@ -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 diff --git a/docs/requirements.txt b/docs/requirements.txt index 4faa57ce..68b4352f 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -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 \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..154acea5 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,2 @@ +[build-system] +requires = ["setuptools", "wheel", "Cython", "pybind11", "numpy"] \ No newline at end of file diff --git a/radvel/__init__.py b/radvel/__init__.py index da458153..2bd1fdfe 100644 --- a/radvel/__init__.py +++ b/radvel/__init__.py @@ -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__) diff --git a/radvel/driver.py b/radvel/driver.py index dc21d593..820023ff 100644 --- a/radvel/driver.py +++ b/radvel/driver.py @@ -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')) diff --git a/radvel/mcmc.py b/radvel/mcmc.py index f940b119..5f4e5bd1 100644 --- a/radvel/mcmc.py +++ b/radvel/mcmc.py @@ -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 diff --git a/radvel/plot/orbit_plots.py b/radvel/plot/orbit_plots.py index 1e5f6ae1..86ba323a 100644 --- a/radvel/plot/orbit_plots.py +++ b/radvel/plot/orbit_plots.py @@ -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 @@ -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) @@ -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)) diff --git a/radvel/tests/test_api.py b/radvel/tests/test_api.py index 7f93f0f2..fb5a387f 100644 --- a/radvel/tests/test_api.py +++ b/radvel/tests/test_api.py @@ -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() diff --git a/requirements.txt b/requirements.txt index 19f9a52d..8e67de39 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 \ No newline at end of file diff --git a/setup.py b/setup.py index 03574f30..ea052324 100644 --- a/setup.py +++ b/setup.py @@ -1,16 +1,7 @@ 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), @@ -18,7 +9,11 @@ def get_property(prop, project): 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(): @@ -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',