Skip to content

Commit

Permalink
Merge pull request #54 from lukashergt/docs_autodoc
Browse files Browse the repository at this point in the history
make full use of autodoc such that cross referencing can find all targets
  • Loading branch information
lukashergt authored Mar 5, 2024
2 parents 12405af + be53a01 commit d764234
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 27 deletions.
6 changes: 3 additions & 3 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = source
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
Expand Down
9 changes: 7 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def get_version(short=False):
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
Expand All @@ -63,12 +64,16 @@ def get_version(short=False):
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
source_suffix = '.rst'
master_doc='index'
master_doc = 'index'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = []

autosummary_generate = True

numpydoc_class_members_toctree = False


# -- Options for HTML output -------------------------------------------------
Expand Down
31 changes: 11 additions & 20 deletions docs/source/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,18 @@
margarine Functions
--------------------

margarine.maf.MAF()
~~~~~~~~~~~~~~~~~~~~
.. automodule:: margarine.maf
:members:
:special-members: __call__

.. automodule:: margarine.maf.MAF()
:members: gen_mades, train, _train_step, _test_step, _training, __call__, sample, log_prob, log_like, save, load
.. automodule:: margarine.kde
:members:
:special-members: __call__

margarine.kde.KDE()
~~~~~~~~~~~~~~~~~~~~
.. automodule:: margarine.clustered
:members:
:special-members: __call__

.. automodule:: margarine.kde.KDE()
:members: generate_kde, __call__, sample, log_prob, log_like, save, load

margarine.clustered.clusterMAF()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. automodule:: margarine.clustered.clusterMAF()
:members: train, __call__, sample, log_prob, log_like, save, load

margarine.marginal_stats.calculate()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. automodule:: margarine.marginal_stats.calculate
:members: statistics
.. automodule:: margarine.marginal_stats
:members:

1 change: 1 addition & 0 deletions margarine/kde.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class KDE(object):
| A list of the relevant parameters to train on. Only needed
if theta is an anestehetic samples object. If not provided,
all parameters will be used.
**Attributes:**
A list of some key attributes accessible to the user.
Expand Down
4 changes: 2 additions & 2 deletions margarine/marginal_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ def integrate(
The definition of zero for the loglikelihood function.
returns:
stats: **dict**
| Dictionary containing useful statistics
stats: **dict**
| Dictionary containing useful statistics
"""
xs = np.empty((sample_size, self.de.theta.shape[-1]))
Expand Down

0 comments on commit d764234

Please sign in to comment.