Skip to content

Commit

Permalink
nicer docs
Browse files Browse the repository at this point in the history
  • Loading branch information
HDembinski committed Sep 27, 2022
1 parent ed9c52b commit 771ea3c
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 8 deletions.
5 changes: 4 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,13 @@
"--InlineBackend.figure_formats={'svg', 'pdf'}",
"--InlineBackend.rc=figure.dpi=96",
]
# nbsphinx_execute = "never" # uncomment this to speed up doc build
# use FAST=1 to speed up doc build
if bool(os.environ.get("FAST", False)):
nbsphinx_execute = "never"

autoclass_content = "both"
autosummary_generate = True
autodoc_member_order = "groupwise"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down
6 changes: 6 additions & 0 deletions doc/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,15 @@ Cost functions

.. automodule:: iminuit.cost
:members:
:inherited-members:

Utilities
---------

.. automodule:: iminuit.util
:exclude-members: Matrix
:inherited-members:

.. autoclass:: iminuit.util.Matrix
:members:
:no-inherited-members:
44 changes: 37 additions & 7 deletions src/iminuit/cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ class BohmZechTransform:
Apply Bohm-Zech transform.
See Bohm and Zech, NIMA 748 (2014) 1-6.
:meta private:
"""

def __init__(self, val: _ArrayLike, var: _ArrayLike):
Expand Down Expand Up @@ -455,21 +457,33 @@ def _soft_l1_cost(y, ye, ym):


class Cost(abc.ABC):
"""Base class for all cost functions."""
"""
Base class for all cost functions.
:meta private:
"""

__slots__ = ("_func_code", "_verbose")

@property
def errordef(self):
"""For internal use."""
"""
For internal use.
:meta private:
"""
return self._errordef()

def _errordef(self):
return CHISQUARE

@property
def func_code(self):
"""For internal use."""
"""
For internal use.
:meta private:
"""
return self._func_code

@property
Expand Down Expand Up @@ -681,7 +695,11 @@ def visualize(


class MaskedCost(Cost):
"""Base class for cost functions that support data masking."""
"""
Base class for cost functions that support data masking.
:meta private:
"""

__slots__ = "_data", "_mask", "_masked"

Expand Down Expand Up @@ -721,7 +739,11 @@ def _update_cache(self):


class UnbinnedCost(MaskedCost):
"""Base class for unbinned cost functions."""
"""
Base class for unbinned cost functions.
:meta private:
"""

__slots__ = "_model", "_log"

Expand Down Expand Up @@ -928,7 +950,11 @@ def _call(self, args):


class BinnedCost(MaskedCost):
"""Base class for binned cost functions."""
"""
Base class for binned cost functions.
:meta private:
"""

__slots__ = "_xe", "_ndim", "_bztrafo"

Expand Down Expand Up @@ -1011,7 +1037,11 @@ def _pred(self, args: _tp.Sequence[float]) -> np.ndarray:


class BinnedCostWithModel(BinnedCost):
"""Base class for binned cost functions."""
"""
Base class for binned cost functions with parametric model.
:meta private:
"""

__slots__ = "_xe_shape", "_model", "_model_arg"

Expand Down
2 changes: 2 additions & 0 deletions src/iminuit/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class BasicView(abc.ABC):
Derived classes need to implement methods _set and _get to access
specific properties of the parameter state.
:meta private:
"""

__slots__ = ("_minuit", "_ndim")
Expand Down

0 comments on commit 771ea3c

Please sign in to comment.