Skip to content

Commit

Permalink
set matplotlib.backend by export
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasplagwitz committed Sep 1, 2020
1 parent a30bddf commit b9c1bb1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
1 change: 1 addition & 0 deletions build_tools/circle/build_doc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ conda create -n $CONDA_ENV_NAME --yes --quiet python="${PYTHON_VERSION:-*}" \
scikit-image="${SCIKIT_IMAGE_VERSION:-*}" pandas="${PANDAS_VERSION:-*}" \
joblib memory_profiler packaging

export MPLBACKEND="agg"
source activate testenv
pip install sphinx-gallery
pip install numpydoc
Expand Down
12 changes: 5 additions & 7 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,18 @@
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import sys
import os
sys.path.insert(0, os.path.abspath('sphinxext'))
import sphinx_gallery

import warnings
import os
import re
from packaging.version import parse
# import pkg_resources
import sys
import skopt

sys.path.insert(0, os.path.abspath('sphinxext'))
from github_link import make_linkcode_resolve
import matplotlib
matplotlib.use('Agg')
import sphinx_gallery


# __version__ = pkg_resources.get_distribution('skopt').version
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
Expand Down
3 changes: 1 addition & 2 deletions examples/exploration-vs-exploitation.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,11 @@ def objective(x, noise_level=noise_level):

def objective_wo_noise(x):
return objective(x, noise_level=0)

#############################################################################


opt = Optimizer([(-2.0, 2.0)], "GP", n_initial_points=3,
acq_optimizer="sampling")

#############################################################################
# Plotting parameters

Expand Down
21 changes: 11 additions & 10 deletions examples/interruptible-optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,15 @@ def obj_fun(x, noise_level=noise_level):

checkpoint_saver = CheckpointSaver("./checkpoint.pkl", compress=9) # keyword arguments will be passed to `skopt.dump`

gp_minimize(obj_fun, # the function to minimize
[(-20.0, 20.0)], # the bounds on each dimension of x
x0=[-20.], # the starting point
acq_func="LCB", # the acquisition function (optional)
n_calls=10, # the number of evaluations of f including at x0
n_random_starts=3, # the number of random initial points
callback=[checkpoint_saver], # a list of callbacks including the checkpoint saver
random_state=777);
gp_minimize(obj_fun, # the function to minimize
[(-20.0, 20.0)], # the bounds on each dimension of x
x0=[-20.], # the starting point
acq_func="LCB", # the acquisition function (optional)
n_calls=10, # number of evaluations of f including at x0
n_random_starts=3, # the number of random initial points
callback=[checkpoint_saver],
# a list of callbacks including the checkpoint saver
random_state=777)

#############################################################################
# Now let's assume this did not finish at once but took some long time: you
Expand Down Expand Up @@ -111,10 +112,10 @@ def obj_fun(x, noise_level=noise_level):
x0=x0, # already examined values for x
y0=y0, # observed values for x0
acq_func="LCB", # the acquisition function (optional)
n_calls=10, # the number of evaluations of f including at x0
n_calls=10, # number of evaluations of f including at x0
n_random_starts=3, # the number of random initialization points
callback=[checkpoint_saver],
random_state=777);
random_state=777)

#############################################################################
# Possible problems
Expand Down

0 comments on commit b9c1bb1

Please sign in to comment.