Skip to content

Commit

Permalink
Fix another rtd bug (#453)
Browse files Browse the repository at this point in the history
* Fix yet another RTD bug causing code-blocks to disappear from html

* Add requirement for newer version of Sphinx

* Add requirement on ipython

* Use python3.6 with rtd-build

* Add extension for ipython-highlighting

* Revert back to python3.5 on rtd-build

* Modify mocked modules

* Modify mocked modules list

* Modify mocked modules list

* Modify mocked modules list

* Modify rtd conf.py

* Bump python version in .readthedocs.yml

* Fix RTD

* Fixing rtd

* Test whether mocking ordering has an effect

* Test if the problem is sklearn.covariance

* Test if the problem is sklearn.utils

* modify mocked modules

* modify mocked modules

* remove sklearn.utils._testing.ignore_warnings

* remove sklearn.utils._testing.ignore_warnings

* Mock abc

* Compile rtd with py38

* Remove unnecessary mocks

* Experiment with mocks

* Experiment with mocks

* Experiment with mocks

* Test mock instead of magicmock

* Remove IPython.sphinxext.ipython_console_highlighting

* Add extension sphinxext.ipython_console_highlighting

* Require ipython!=8.7.0

* Test ipython3 -> python

* Modify .readthedocs.yml

* Modify quickstart.rst code-blocks

* Pin ipython-version in requirements.txt

* Fix a typo

* Modify requirements-dev

* Test code-block instead of code for indicating code blocks

* Revert to old package-versions

* Add nbsphinx into requirements

* Pin docutils version

* Pin docutils version

* Pin pillow==5.4.1

* unpin package versions

* Add nbsphinx in requirements

* Require newer Sphinx

* Update packages

* Update packages

* Update packages

* Pin more versions

* Remove ipython sphinx extension

* Add more mocked packages

* Test code vs code-block logic

* Test code vs code-block logic

* Test code vs code-block logic

* Test code vs code-block logic

* Change requirements.txt

* Hail mary

* Add pandoc in requirements

* Modify quickstart.rst

* Bring back old requirements.txt

* Return to original

* Add docs/requirements.txt file

* Change all .. code:: to .. code-block::

* Remove quickstart.rst

* Revert back to old format

* Remove mocking of elfi

* Remove mocking of elfi

* Pin packages for docs

* Remove pygments_style in conf.py

* add autodoc-setup to conf.py

* Hail mary v0.2

* Discard nbsphinx

* remove import elfi from docs

* remove import elfi from docs

* Use python36

* modify requirements

* Use python36

* Back to basic formulation with nbsphinx

* Remove clutter from requirements.txt

* Fix few bugs

* Modify CHANGELOG
  • Loading branch information
hpesonen committed Jan 16, 2023
1 parent e0fbbca commit 5b5db3f
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ formats:
python:
version: 3.6
install:
- requirements: requirements.txt
- requirements: docs/requirements.txt
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Changelog
=========

- Fix readthedocs configuration
- Update penalty to shrinkage parameter conversion in synthetic likelihood calculation
- Update BSL pre sample methods
- Update BslSample
Expand Down
15 changes: 7 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,17 @@
# 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', 'distributed.client', 'graphviz', 'matplotlib', 'sobol_seq', 'GPy',
'GPy.kern', 'GPy.models',
'dask.delayed', 'scipy.linalg', 'scipy.optimize', 'scipy.stats', 'scipy.spatial',
'scipy.sparse', 'scipy.special', 'matplotlib.pyplot', 'numpy.random', 'networkx',
'ipyparallel', 'numpy.lib', 'numpy.lib.format', 'sklearn.linear_model',
Expand Down Expand Up @@ -93,12 +92,12 @@ def setup(app):
'sphinx.ext.viewcode',
'sphinx.ext.autosummary',
'sphinx.ext.napoleon',
'IPython.sphinxext.ipython_console_highlighting',
'nbsphinx',
# 'IPython.sphinxext.ipython_console_highlighting',
# Inheritance diagrams
# 'sphinx.ext.graphviz',
# 'sphinx.ext.inheritance_diagram',
'sphinx.ext.graphviz',
'sphinx.ext.inheritance_diagram'
]

autoclass_content = 'both'

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -136,7 +135,7 @@ def setup(app):
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = "en"
language = 'en'

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand All @@ -150,7 +149,7 @@ def setup(app):
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ['_build', '**.ipynb_checkpoints', 'Thumbs.db', '.DS_Store']

# The reST default role (used for this markup: `text`) to use for all
# documents.
Expand Down
31 changes: 31 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Documentation
dask[distributed]>=2.30.0
numpy>=1.12.1
scipy>=0.19
matplotlib>=1.1
GPy>=1.0.9
networkX>=2.0
ipyparallel>=6
toolz>=0.8
scikit-learn>=0.18.1
numdifftools>=0.9
sphinx==1.8.6
sphinx-rtd-theme==0.4.3
sphinxcontrib-serializinghtml==1.1.5
sphinxcontrib-websupport==1.2.4
urllib3==1.26.9
Pygments==2.12.0
readthedocs-sphinx-ext==2.1.8
jinja2==3.0.3
docutils==0.17.1
ipykernel==5.5.6
ipyparallel==8.2.1
ipython==7.16.3
ipython-genutils==0.2.0
jedi==0.17.2
MarkupSafe==2.0.1
future==0.18.2
pillow==5.4.1
alabaster==0.7.12
commonmark==0.8.0
nbsphinx
2 changes: 1 addition & 1 deletion docs/usage/BOLFI.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ surface is updated after each batch (especially so if the noise is 0!).
.. code:: ipython3
bolfi = elfi.BOLFI(log_d, batch_size=1, initial_evidence=20, update_interval=10,
bounds={'t1':(-2, 2), 't2':(-1, 1)}, acq_noise_var=0.1, seed=seed)
bounds={'t1':(-2, 2), 't2':(-1, 1)}, acq_noise_var=[0.1, 0.1], seed=seed)
Sometimes you may have some samples readily available. You could then
initialize the GP model with a dictionary of previous results by giving
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/implementing-methods.rst
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ is the final complete implementation of our inference method class::

import numpy as np

from elfi.methods.parameter_inference import ParameterInference
from elfi.methods.inference.parameter_inference import ParameterInference
from elfi.methods.results import Sample


Expand Down
4 changes: 2 additions & 2 deletions elfi/methods/inference/parameter_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __init__(self,
Parameters
----------
model : ElfiModel
model : elfi.ElfiModel
Model to perform the inference with.
output_names : list
Names of the nodes whose outputs will be requested from the ELFI graph.
Expand All @@ -67,7 +67,7 @@ def __init__(self,
a significant performance boost.
seed : int, optional
Seed for the data generation from the ElfiModel
pool : OutputPool, optional
pool : elfi.store.OutputPool, optional
OutputPool both stores and provides precomputed values for batches.
max_parallel_batches : int, optional
Maximum number of batches allowed to be in computation at the same time.
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ importlib-metadata<5.0.0


# Documentation
Sphinx>=1.4.8
Sphinx>=1.4.8

0 comments on commit 5b5db3f

Please sign in to comment.