Skip to content

Commit

Permalink
more imporemvents
Browse files Browse the repository at this point in the history
  • Loading branch information
erikbern committed May 30, 2018
1 parent 0e70e2e commit e72b07e
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ python:
before_install:
- pip install pytest pytest-cov
- pip install coveralls
- pip install sphinx autoapi
install:
- pip install pytest flaky -r requirements.txt
script:
- py.test -s -v --cov=convoys .
- sphinx-build -M html docs/ docs/_build/
after_success:
- coveralls
15 changes: 12 additions & 3 deletions convoys/regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
from convoys.gamma import gammainc


__all__ = ['GeneralizedGamma',
'Weibull',
'Gamma',
'Exponential']


def generalized_gamma_LL(x, X, B, T, W, fix_k, fix_p):
k = exp(x[0]) if fix_k is None else fix_k
p = exp(x[1]) if fix_p is None else fix_p
Expand Down Expand Up @@ -59,9 +65,12 @@ class RegressionModel(object):


class GeneralizedGamma(RegressionModel):
# https://en.wikipedia.org/wiki/Generalized_gamma_distribution
# Note however that lambda is a^-1 in WP's notation
# Note also that k = d/p so d = k*p
''' Generalization of Gamma, Weibull, and Exponential
See https://en.wikipedia.org/wiki/Generalized_gamma_distribution
Note however that lambda is a^-1 in WP's notation
Note also that k = d/p so d = k*p
'''
def __init__(self, ci=False):
self._ci = ci

Expand Down
109 changes: 109 additions & 0 deletions docs/_templates/autoapi/module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
=={{ '=' * node.name|length }}==
``{{ node.name }}``
=={{ '=' * node.name|length }}==

.. automodule:: {{ node.name }}

.. contents::
:local:
{##}
{%- block modules -%}
{%- if subnodes %}

Submodules
==========

.. toctree::
{% for item in subnodes %}
{{ item.name }}
{%- endfor %}
{##}
{%- endif -%}
{%- endblock -%}
{##}
.. currentmodule:: {{ node.name }}
{##}
{%- block functions -%}
{%- if node.functions %}

Functions
=========

{% for item, obj in node.functions.items() -%}
- :py:func:`{{ item }}`:
{{ obj|summary }}

{% endfor -%}

{% for item in node.functions %}
.. autofunction:: {{ item }}
{##}
{%- endfor -%}
{%- endif -%}
{%- endblock -%}

{%- block classes -%}
{%- if node.classes %}

Classes
=======

{% for item, obj in node.classes.items() -%}
- :py:class:`{{ item }}`:
{{ obj|summary }}

{% endfor -%}

{% for item in node.classes %}
.. autoclass:: {{ item }}
:members:

{##}
{%- endfor -%}
{%- endif -%}
{%- endblock -%}

{%- block exceptions -%}
{%- if node.exceptions %}

Exceptions
==========

{% for item, obj in node.exceptions.items() -%}
- :py:exc:`{{ item }}`:
{{ obj|summary }}

{% endfor -%}

{% for item in node.exceptions %}
.. autoexception:: {{ item }}

.. rubric:: Inheritance
.. inheritance-diagram:: {{ item }}
:parts: 1
{##}
{%- endfor -%}
{%- endif -%}
{%- endblock -%}

{%- block variables -%}
{%- if node.variables %}

Variables
=========

{% for item, obj in node.variables.items() -%}
- :py:data:`{{ item }}`
{% endfor -%}

{% for item, obj in node.variables.items() %}
.. autodata:: {{ item }}
:annotation:

.. code-block:: guess
{{ obj|pprint|indent(6) }}
{##}
{%- endfor -%}
{%- endif -%}
{%- endblock -%}
8 changes: 8 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'autoapi.sphinx',
]

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -112,3 +113,10 @@

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True

# Custom overrides
autoapi_modules = {
'convoys': {
'output': 'api',
}
}
6 changes: 4 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.. autosummary::
Full API documentation
======================

convoys.regression
.. toctree::

api/convoys

0 comments on commit e72b07e

Please sign in to comment.