Skip to content

Commit

Permalink
mocking and docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
dfm committed Nov 27, 2018
1 parent 9817104 commit 4b846ba
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 27 deletions.
22 changes: 1 addition & 21 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,13 @@

import sphinx_nameko_theme

# Mock most of the dependencies
import sys
from unittest.mock import MagicMock


class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return MagicMock()


MOCK_MODULES = [
autodoc_mock_imports = [
"numpy",
"scipy",
"astropy",
"astropy.stats",
"astropy.units",
"astropy.constants",
"pymc3",
"pymc3.step_methods.hmc",
"pymc3.distributions",
"pymc3.distributions.transforms",
"theano",
"theano.ifelse",
"theano.tensor",
]
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)

import exoplanet # NOQA

Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
sphinx>=1.7.5
pandoc
jupyter
sphinx-nameko-theme
5 changes: 3 additions & 2 deletions docs/user/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ Distributions

.. autoclass:: exoplanet.distributions.UnitVector
.. autoclass:: exoplanet.distributions.Angle
.. autoclass:: exoplanet.distributions.Triangle
.. autoclass:: exoplanet.distributions.RadiusImpactParameter
.. autoclass:: exoplanet.distributions.QuadLimbDark
.. autoclass:: exoplanet.distributions.RadiusImpact
.. autofunction:: exoplanet.distributions.get_joint_radius_impact


Utilities
Expand Down
8 changes: 4 additions & 4 deletions exoplanet/distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,12 @@ def get_joint_radius_impact(name="", N_planets=None,
"""Get the joint distribution over radius and impact parameter
This uses the Espinoza (2018) parameterization of the distribution (see
:class:`distributions.RadiusImpactParameter` for more details).
:class:`distributions.RadiusImpact` for more details).
Args:
name (Optional[str]): A prefix that is added to all distribution names
used in this parameterization. For example, if ``name`` is
``param_``, vars will be added to the PyMC3 model with names:
``param_``, vars will be added to the PyMC3 model with names
``param_rb`` (for the joint distribution), ``param_b``, and
``param_r``.
N_planets (Optional[int]): The number of planets. If not provided, it
Expand All @@ -223,8 +223,8 @@ def get_joint_radius_impact(name="", N_planets=None,
``N_planets`` entries.
Returns:
r (Deterministic): The planet radius parameter.
b (Deterministic): The impact parameter.
Two ``pymc3.Deterministic`` variables for the planet radius and impact
parameter.
"""
if N_planets is None:
Expand Down

0 comments on commit 4b846ba

Please sign in to comment.