Skip to content

Commit

Permalink
Some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose Gomez-Dans committed Oct 29, 2018
1 parent d776820 commit dfc6616
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 88 deletions.
9 changes: 0 additions & 9 deletions docs/.readthedocs.yml

This file was deleted.

4 changes: 2 additions & 2 deletions docs/Makefile
Expand Up @@ -5,7 +5,7 @@
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = .
BUILDDIR = ..
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
Expand All @@ -16,4 +16,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
69 changes: 13 additions & 56 deletions docs/conf.py
Expand Up @@ -12,14 +12,11 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
#sys.path.append(os.path.abspath('sphinxext'))

sys.path.insert(0, os.path.abspath('../..'))
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))
import matplotlib
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

project = 'gp_emulator'
Expand All @@ -29,35 +26,9 @@
# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = '1.6.5'

try:
from gp_emulator import __version__ as version
except ImportError:
pass
else:
release = version

# -- Hack for ReadTheDocs ------------------------------------------------------
# This hack is necessary since RTD does not issue `sphinx-apidoc` before running
# `sphinx-build -b html . _build/html`. See Issue:
# https://github.com/rtfd/readthedocs.org/issues/1139
# DON'T FORGET: Check the box "Install your project inside a virtualenv using
# setup.py install" in the RTD Advanced Settings.

on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if on_rtd:
import inspect
from sphinx import apidoc

__location__ = os.path.join(os.getcwd(), os.path.dirname(
inspect.getfile(inspect.currentframe())))

output_dir = os.path.join(__location__, "../docs/api")
module_dir = os.path.join(__location__, "../gp_emulator/")
cmd_line_template = "sphinx-apidoc -f -o {outputdir} {moduledir}"
cmd_line = cmd_line_template.format(outputdir=output_dir, moduledir=module_dir)
apidoc.main(cmd_line.split(" "))
release = ''


# -- General configuration ---------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand All @@ -67,22 +38,13 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [ 'matplotlib.sphinxext.mathmpl',
'matplotlib.sphinxext.plot_directive',
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode'
extensions = [
'matplotlib.sphinxext.plot_directive',
'sphinx.ext.autodoc',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
]

plot_include_source = True
plot_html_show_source_link = False
plot_html_show_formats = False
plot_working_directory = '.'
plot_rcparams = {
'figure.figsize': (10, 4)
}
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand Down Expand Up @@ -216,8 +178,3 @@


# -- Extension configuration -------------------------------------------------

# -- Options for intersphinx extension ---------------------------------------

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
4 changes: 2 additions & 2 deletions docs/index.rst
@@ -1,5 +1,5 @@
.. gp_emulator documentation master file, created by
sphinx-quickstart on Thu Sep 20 12:56:27 2018.
sphinx-quickstart on Mon Oct 29 16:05:31 2018.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Expand All @@ -11,7 +11,7 @@ Welcome to gp_emulator's documentation!
:caption: Contents:

introduction.rst
module_docs.rst


Indices and tables
==================
Expand Down
14 changes: 0 additions & 14 deletions docs/module_docs.rst

This file was deleted.

4 changes: 1 addition & 3 deletions docs/requirements.txt
@@ -1,4 +1,2 @@
sphinxcontrib-napoleon
matplotlib>2.0.0


matplotlib>=2.0.0
4 changes: 2 additions & 2 deletions gp_emulator/GaussianProcess.py
Expand Up @@ -93,8 +93,8 @@ def _prepare_likelihood(self):

exp_theta = np.exp(self.theta)
# Calculation of the covariance matrix Q using theta
self.Z = dist.cdist(np.sqrt(expX[: (self.D)])*self.inputs,
np.sqrt(expX[: (self.D)])*self.inputs,
self.Z = dist.cdist(np.sqrt(exp_theta[: (self.D)])*self.inputs,
np.sqrt(exp_theta[: (self.D)])*self.inputs,
"sqeuclidean")
self.Z = exp_theta[self.D] * np.exp(-0.5 * self.Z)
self.Q = self.Z + exp_theta[self.D + 1] * np.eye(self.n)
Expand Down

0 comments on commit dfc6616

Please sign in to comment.