Skip to content

Commit

Permalink
Merge branch 'docs_mock'
Browse files Browse the repository at this point in the history
  • Loading branch information
vuolleko committed Dec 2, 2016
2 parents 66258c9 + 397ec73 commit 5df48f0
Show file tree
Hide file tree
Showing 11 changed files with 239 additions and 48 deletions.
40 changes: 23 additions & 17 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
MIT License
Copyright (c) 2016, Helsinki Institute for Information Technology
All rights reserved.

Copyright (c) 2016 Helsinki Institute for Information Technology
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
1. Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
2. Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3. Neither the name of the copyright holder nor the names of its contributors may
be used to endorse or promote products derived from this software without specific
prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ELFI - Engine for Likelihood-Free Inference
-->

[![Build Status](https://travis-ci.com/HIIT/elfi.svg?token=xAu1DN2J4WjCapVWLinn&branch=dev)](https://travis-ci.com/HIIT/elfi)
[![Documentation Status](https://readthedocs.org/projects/elfi/badge/?version=latest)](http://elfi.readthedocs.io/en/latest/?badge=latest)

<img src="https://cloud.githubusercontent.com/assets/1233418/20178983/6e22ee44-a75c-11e6-8345-5934b55b9dc6.png" width="15%" align="right"></img>

Expand All @@ -27,7 +28,7 @@ Currently implemented ABC methods:
- Sequential Monte Carlo sampler
- [Bayesian Optimization for Likelihood-Free Inference (BOLFI) framework](https://arxiv.org/abs/1501.03291)

See examples under [notebooks](notebooks) to get started.
See examples under [notebooks](notebooks) to get started. Full documentation can be found at http://elfi.readthedocs.io/.

<!-- ..
Installation
Expand Down
24 changes: 23 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,28 @@
import sys
import os

# http://docs.readthedocs.io/en/latest/faq.html#i-get-import-errors-on-libraries-that-depend-on-c-modules
from unittest.mock import MagicMock

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

on_RTD = os.environ.get('READTHEDOCS', None) == 'True'
if on_RTD:
MOCK_MODULES = ['pygtk', 'gtk', 'gobject', 'argparse', 'numpy', 'pandas', 'scipy', 'unqlite',
'dask', 'distributed', 'graphviz', 'matplotlib', 'sobol_seq', 'GPy', 'dask.delayed',
'scipy.optimize', 'scipy.stats', 'matplotlib.pyplot', 'numpy.random', 'distributed.client']
# 'scipy.optimize', 'scipy.stats', 'matplotlib', 'matplotlib.pyplot', 'GPy']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)

html_theme = 'default'

else:
html_theme = 'sphinx_rtd_theme'


# If extensions (or modules to document with autodoc) are in another
# directory, add these directories to sys.path here. If the directory is
# relative to the documentation root, use os.path.abspath to make it
Expand Down Expand Up @@ -142,7 +164,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
# html_theme = 'alabaster'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down
22 changes: 11 additions & 11 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ Installation
============


Stable release
--------------
.. Stable release
.. --------------
To install ELFI, run this command in your terminal:
.. To install ELFI, run this command in your terminal:
.. code-block:: console
.. .. code-block:: console
$ pip install elfi
.. $ pip install elfi
This is the preferred method to install ELFI, as it will always install the most recent stable release.
.. This is the preferred method to install ELFI, as it will always install the most recent stable release.
If you don't have `pip`_ installed, this `Python installation guide`_ can guide
you through the process.
.. If you don't have `pip`_ installed, this `Python installation guide`_ can guide
.. you through the process.
.. _pip: https://pip.pypa.io
.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/
.. .. _pip: https://pip.pypa.io
.. .. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/
From sources
Expand All @@ -32,7 +32,7 @@ You can either clone the public repository:

.. code-block:: console
$ git clone git://github.com/HIIT/elfi
$ git clone https://github.com/HIIT/elfi.git
Or download the `tarball`_:

Expand Down
1 change: 1 addition & 0 deletions docs/readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The probabilistic inference model is defined as a directed acyclic graph, which
.. _Dask: https://dask.pydata.org

Currently implemented ABC methods:

- rejection sampler
- Sequential Monte Carlo sampler
- Bayesian Optimization for Likelihood-Free Inference (BOLFI_) framework
Expand Down
38 changes: 38 additions & 0 deletions docs/source/elfi.bo.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
elfi.bo package
===============

Submodules
----------

elfi.bo.acquisition module
--------------------------

.. automodule:: elfi.bo.acquisition
:members:
:undoc-members:
:show-inheritance:

elfi.bo.gpy_model module
------------------------

.. automodule:: elfi.bo.gpy_model
:members:
:undoc-members:
:show-inheritance:

elfi.bo.utils module
--------------------

.. automodule:: elfi.bo.utils
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: elfi.bo
:members:
:undoc-members:
:show-inheritance:
109 changes: 109 additions & 0 deletions docs/source/elfi.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
elfi package
============

Subpackages
-----------

.. toctree::

elfi.bo

Submodules
----------

elfi.async module
-----------------

.. automodule:: elfi.async
:members:
:undoc-members:
:show-inheritance:

elfi.core module
----------------

.. automodule:: elfi.core
:members:
:undoc-members:
:show-inheritance:

elfi.decorators module
----------------------

.. automodule:: elfi.decorators
:members:
:undoc-members:
:show-inheritance:

elfi.distributions module
-------------------------

.. automodule:: elfi.distributions
:members:
:undoc-members:
:show-inheritance:

elfi.env module
---------------

.. automodule:: elfi.env
:members:
:undoc-members:
:show-inheritance:

elfi.methods module
-------------------

.. automodule:: elfi.methods
:members:
:undoc-members:
:show-inheritance:

elfi.posteriors module
----------------------

.. automodule:: elfi.posteriors
:members:
:undoc-members:
:show-inheritance:

elfi.storage module
-------------------

.. automodule:: elfi.storage
:members:
:undoc-members:
:show-inheritance:

elfi.utils module
-----------------

.. automodule:: elfi.utils
:members:
:undoc-members:
:show-inheritance:

elfi.visualization module
-------------------------

.. automodule:: elfi.visualization
:members:
:undoc-members:
:show-inheritance:

elfi.wrapper module
-------------------

.. automodule:: elfi.wrapper
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: elfi
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/source/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
elfi
====

.. toctree::
:maxdepth: 4

elfi
4 changes: 4 additions & 0 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ Usage
To use ELFI in a project::

import elfi

For tutorials, please see the Jupyter Notebooks under the `notebooks directory`_.

.. _notebooks directory: https://github.com/HIIT/elfi/tree/master/notebooks
2 changes: 1 addition & 1 deletion elfi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

__author__ = 'ELFI authors'
__email__ = 'aki.vehtari@aalto.fi'
__version__ = '0.1.0'
__version__ = '0.2.0'
37 changes: 20 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
import os
from setuptools import setup
from io import open

with open('README.md', 'r', encoding='utf-8') as f:
long_description = f.read()

requirements = [
'toolz>=0.8',
'distributed>=1.13.3',
'graphviz>=0.5',
'cairocffi>=0.7',
'dask>=0.11.1',
'sobol_seq>=0.1.2',
'numpy>=1.8',
'scipy>=0.16.1',
'Cython>=0.25.1',
'matplotlib>=1.1',
'GPy>=1.0.9',
'unqlite>=0.6.0'
]

setup(
name='elfi',
packages=['elfi'],
version='0.1',
version='0.3',
author='HIIT',
author_email='aki.vehtari@aalto.fi',
url='https://github.com/HIIT/elfi',

install_requires=[
'numpy>=1.8',
'scipy>=0.16.1',
'toolz>=0.8',
'distributed>=1.13.3',
'graphviz>=0.5',
'cairocffi>=0.7',
'dask>=0.11.1',
'matplotlib>=1.1',
'sobol_seq>=0.1.2',
'GPy>=1.0.9',
'Cython>=0.25.1',
'unqlite>=0.6.0'
],
install_requires=requirements,

extras_require={
'doc': ['Sphinx'],
Expand All @@ -34,7 +37,7 @@
description='Modular ABC inference framework for python',
long_description=long_description,

license='MIT',
license='BSD3',

classifiers=['Programming Language :: Python',
'Topic :: Scientific/Engineering',
Expand All @@ -43,4 +46,4 @@
'Operating System :: OS Independent',
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License'])
'License :: OSI Approved :: BSD3 License'])

0 comments on commit 5df48f0

Please sign in to comment.